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 17 jdk.jconsole.jmod - JConsole Tool
JDK 17 jdk.jconsole.jmod is the JMOD file for JDK 17 JConsole tool, which can be invoked by the "jconsole" command.
JDK 17 JConsole tool compiled class files are stored in \fyicenter\jdk-17.0.5\jmods\jdk.jconsole.jmod.
JDK 17 JConsole tool compiled class files are also linked and stored in the \fyicenter\jdk-17.0.5\lib\modules JImage file.
JDK 17 JConsole tool source code files are stored in \fyicenter\jdk-17.0.5\lib\src.zip\jdk.jconsole.
You can click and view the content of each source code file in the list below.
✍: FYIcenter
⏎ sun/tools/jconsole/VariableGridLayout.java
/* * Copyright (c) 2004, 2012, Oracle and/or its affiliates. All rights reserved. * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. * * * * * * * * * * * * * * * * * * * * */ package sun.tools.jconsole; import java.awt.*; import javax.swing.*; @SuppressWarnings("serial") public class VariableGridLayout extends GridLayout { private boolean fillRows, fillColumns; public VariableGridLayout(int rows, int cols, int hgap, int vgap, boolean fillRows, boolean fillColumns) { super(rows, cols, hgap, vgap); this.fillRows = fillRows; this.fillColumns = fillColumns; } public void setFillRow(JComponent c, boolean b) { c.putClientProperty("VariableGridLayout.fillRow", b); } public void setFillColumn(JComponent c, boolean b) { c.putClientProperty("VariableGridLayout.fillColumn", b); } public boolean getFillRow(JComponent c) { Boolean b = (Boolean)c.getClientProperty("VariableGridLayout.fillRow"); return (b != null) ? b : fillRows; } public boolean getFillColumn(JComponent c) { Boolean b = (Boolean)c.getClientProperty("VariableGridLayout.fillColumn"); return (b != null) ? b : fillColumns; } public void layoutContainer(Container parent) { Insets insets = parent.getInsets(); int ncomponents = parent.getComponentCount(); int nrows = getRows(); int ncols = getColumns(); int hgap = getHgap(); int vgap = getVgap(); if (nrows > 0) { ncols = (ncomponents + nrows - 1) / nrows; } else { nrows = (ncomponents + ncols - 1) / ncols; } // Set heights int x; int y; int nFills = 0; boolean[] fills = new boolean[nrows]; int lastFillRow = -1; int nComps = parent.getComponentCount(); y = insets.top; for (int row = 0; row < nrows; row++) { // Find largest minimum height for this row int h = 0; for (int col = 0; col < ncols; col++) { if (row * ncols + col < nComps) { Component c = parent.getComponent(row * ncols + col); h = Math.max(h, c.getMinimumSize().height); } } // Set heights for this row x = insets.left; for (int col = 0; col < ncols; col++) { if (row * ncols + col < nComps) { JComponent c = (JComponent)parent.getComponent(row * ncols + col); int w = c.getWidth(); c.setBounds(x, y, w, h); x += w + hgap; if (col == 0 && getFillRow(c)) { fills[row] = true; } } } y += h + vgap; if (fills[row]) { nFills++; lastFillRow = row; } } // Fill heights if (nFills > 0 && y < parent.getHeight()) { // How much height to add int hAdd = (parent.getHeight() - y) / nFills; int hAdded = 0; for (int row = 0; row < nrows; row++) { if (fills[row]) { if (row == lastFillRow) { // Compensate for rounding error hAdd = parent.getHeight() - (y+hAdded); } for (int col = 0; col < ncols; col++) { if (row * ncols + col < nComps) { Component c = parent.getComponent(row * ncols + col); Rectangle b = c.getBounds(); c.setBounds(b.x, b.y + hAdded, b.width, b.height + hAdd); } } hAdded += hAdd; } } } // Set widths nFills = 0; fills = new boolean[ncols]; int lastFillCol = -1; x = insets.left; for (int col = 0; col < ncols; col++) { // Find largest minimum width for this column int w = 0; for (int row = 0; row < nrows; row++) { if (row * ncols + col < nComps) { Component c = parent.getComponent(row * ncols + col); w = Math.max(w, c.getMinimumSize().width); } } // Set widths for this column y = insets.top; for (int row = 0; row < nrows; row++) { if (row * ncols + col < nComps) { JComponent c = (JComponent)parent.getComponent(row * ncols + col); int h = c.getHeight(); c.setBounds(x, y, w, h); y += h + vgap; if (row == 0 && getFillColumn(c)) { fills[col] = true; } } } x += w + hgap; if (fills[col]) { nFills++; lastFillCol = col; } } // Fill widths if (nFills > 0 && x < parent.getWidth()) { // How much width to add int wAdd = (parent.getWidth() - x) / nFills; int wAdded = 0; for (int col = 0; col < ncols; col++) { if (fills[col]) { if (col == lastFillCol) { wAdd = parent.getWidth() - (x+wAdded); } for (int row = 0; row < nrows; row++) { if (row * ncols + col < nComps) { Component c = parent.getComponent(row * ncols + col); Rectangle b = c.getBounds(); c.setBounds(b.x + wAdded, b.y, b.width + wAdd, b.height); } } wAdded += wAdd; } } } } public Dimension preferredLayoutSize(Container parent) { Insets insets = parent.getInsets(); int ncomponents = parent.getComponentCount(); int nrows = getRows(); int ncols = getColumns(); int hgap = getHgap(); int vgap = getVgap(); if (nrows > 0) { ncols = (ncomponents + nrows - 1) / nrows; } else { nrows = (ncomponents + ncols - 1) / ncols; } int nComps = parent.getComponentCount(); int y = insets.top; for (int row = 0; row < nrows; row++) { int h = 0; for (int col = 0; col < ncols; col++) { if (row * ncols + col < nComps) { Component c = parent.getComponent(row * ncols + col); h = Math.max(h, c.getMinimumSize().height); } } y += h + vgap; } int x = insets.left; for (int col = 0; col < ncols; col++) { int w = 0; for (int row = 0; row < nrows; row++) { if (row * ncols + col < nComps) { Component c = parent.getComponent(row * ncols + col); w = Math.max(w, c.getMinimumSize().width); } } x += w + hgap; } return new Dimension(x, y); } }
⏎ sun/tools/jconsole/VariableGridLayout.java
Or download all of them as a single archive file:
File name: jdk.jconsole-17.0.5-src.zip File size: 169450 bytes Release date: 2022-09-13 Download
⇒ JDK 17 jdk.jdeps.jmod - JDeps Tool
2023-04-17, 3547👍, 0💬
Popular Posts:
Joda-Time provides a quality replacement for the Java date and time classes. The design allows for m...
What Is jniwrap.jar in JNIWrapper 3.7.1? winpack.jar in JNIWrapper 3.7.1 is an add-on JAR file for J...
What is the dom\GetElementsByTagName .javaprovided in the Apache Xerces package? I have Apache Xerce...
JasperReports, the world's most popular open source business intelligence and reporting engine and J...
commons-lang-1.0.1.jar is the JAR file for Apache Commons Lang 1.0.1, which provides a host of helpe...