Categories:
Audio (13)
Biotech (29)
Bytecode (36)
Database (77)
Framework (7)
Game (7)
General (507)
Graphics (53)
I/O (35)
IDE (2)
JAR Tools (101)
JavaBeans (21)
JDBC (121)
JDK (426)
JSP (20)
Logging (108)
Mail (58)
Messaging (8)
Network (84)
PDF (97)
Report (7)
Scripting (84)
Security (32)
Server (121)
Servlet (26)
SOAP (24)
Testing (54)
Web (15)
XML (309)
Collections:
Other Resources:
JDK 11 java.desktop.jmod - Desktop Module
JDK 11 java.desktop.jmod is the JMOD file for JDK 11 Desktop module.
JDK 11 Desktop module compiled class files are stored in \fyicenter\jdk-11.0.1\jmods\java.desktop.jmod.
JDK 11 Desktop module compiled class files are also linked and stored in the \fyicenter\jdk-11.0.1\lib\modules JImage file.
JDK 11 Desktop module source code files are stored in \fyicenter\jdk-11.0.1\lib\src.zip\java.desktop.
You can click and view the content of each source code file in the list below.
✍: FYIcenter
⏎ javax/swing/colorchooser/SmartGridLayout.java
/* * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved. * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. * * * * * * * * * * * * * * * * * * * * */ package javax.swing.colorchooser; import javax.swing.*; import java.awt.*; import java.awt.event.*; import javax.swing.event.*; import javax.swing.text.*; import java.io.Serializable; /** * A better GridLayout class * * @author Steve Wilson */ @SuppressWarnings("serial") // Same-version serialization only class SmartGridLayout implements LayoutManager, Serializable { int rows = 2; int columns = 2; int xGap = 2; int yGap = 2; int componentCount = 0; Component[][] layoutGrid; public SmartGridLayout(int numColumns, int numRows) { rows = numRows; columns = numColumns; layoutGrid = new Component[numColumns][numRows]; } public void layoutContainer(Container c) { buildLayoutGrid(c); int[] rowHeights = new int[rows]; int[] columnWidths = new int[columns]; for (int row = 0; row < rows; row++) { rowHeights[row] = computeRowHeight(row); } for (int column = 0; column < columns; column++) { columnWidths[column] = computeColumnWidth(column); } Insets insets = c.getInsets(); if (c.getComponentOrientation().isLeftToRight()) { int horizLoc = insets.left; for (int column = 0; column < columns; column++) { int vertLoc = insets.top; for (int row = 0; row < rows; row++) { Component current = layoutGrid[column][row]; current.setBounds(horizLoc, vertLoc, columnWidths[column], rowHeights[row]); // System.out.println(current.getBounds()); vertLoc += (rowHeights[row] + yGap); } horizLoc += (columnWidths[column] + xGap ); } } else { int horizLoc = c.getWidth() - insets.right; for (int column = 0; column < columns; column++) { int vertLoc = insets.top; horizLoc -= columnWidths[column]; for (int row = 0; row < rows; row++) { Component current = layoutGrid[column][row]; current.setBounds(horizLoc, vertLoc, columnWidths[column], rowHeights[row]); // System.out.println(current.getBounds()); vertLoc += (rowHeights[row] + yGap); } horizLoc -= xGap; } } } public Dimension minimumLayoutSize(Container c) { buildLayoutGrid(c); Insets insets = c.getInsets(); int height = 0; int width = 0; for (int row = 0; row < rows; row++) { height += computeRowHeight(row); } for (int column = 0; column < columns; column++) { width += computeColumnWidth(column); } height += (yGap * (rows - 1)) + insets.top + insets.bottom; width += (xGap * (columns - 1)) + insets.right + insets.left; return new Dimension(width, height); } public Dimension preferredLayoutSize(Container c) { return minimumLayoutSize(c); } public void addLayoutComponent(String s, Component c) {} public void removeLayoutComponent(Component c) {} private void buildLayoutGrid(Container c) { Component[] children = c.getComponents(); for (int componentCount = 0; componentCount < children.length; componentCount++) { // System.out.println("Children: " +componentCount); int row = 0; int column = 0; if (componentCount != 0) { column = componentCount % columns; row = (componentCount - column) / columns; } // System.out.println("inserting into: "+ column + " " + row); layoutGrid[column][row] = children[componentCount]; } } private int computeColumnWidth(int columnNum) { int maxWidth = 1; for (int row = 0; row < rows; row++) { int width = layoutGrid[columnNum][row].getPreferredSize().width; if (width > maxWidth) { maxWidth = width; } } return maxWidth; } private int computeRowHeight(int rowNum) { int maxHeight = 1; for (int column = 0; column < columns; column++) { int height = layoutGrid[column][rowNum].getPreferredSize().height; if (height > maxHeight) { maxHeight = height; } } return maxHeight; } }
⏎ javax/swing/colorchooser/SmartGridLayout.java
Or download all of them as a single archive file:
File name: java.desktop-11.0.1-src.zip File size: 7974380 bytes Release date: 2018-11-04 Download
⇒ JDK 11 java.instrument.jmod - Instrument Module
2022-08-06, 194566👍, 5💬
Popular Posts:
Jackson is "the Java JSON library" or "the best JSON parser for Java". Or simply as "JSON for Java"....
JAX-WS is an API for building web services and clients. It is the next generation Web Services API r...
What Is commons-codec-1.4.jar? commons-codec-1.4.jar is the JAR file for Apache Commons Codec 1.4, w...
MXP1 is a stable XmlPull parsing engine that is based on ideas from XPP and in particular XPP2 but c...
commons-lang-2.6.jar is the JAR file for Apache Commons Lang 2.6, which provides a host of helper ut...