public final class LookAndFeelUtil extends Object
Module: swing-util-api
To use this in your app, include the following dependency in your POM:
<dependency> <groupId>org.cytoscape</groupId> <artifactId>swing-util-api</artifactId> </dependency>
Modifier and Type | Method and Description |
---|---|
static JPanel |
createOkCancelPanel(JButton okBtn,
JButton cancelBtn)
Use this method to create a standard Cytoscape panel (usually added to the bottom of a dialog)
that contains an "OK" and/or a "Cancel" button.
|
static JPanel |
createOkCancelPanel(JButton okBtn,
JButton cancelBtn,
JComponent... otherComponents)
Use this method to create a standard Cytoscape panel (usually added to the bottom of a dialog)
that contains an "OK" and/or a "Cancel" button, as well as other extra components.
|
static Border |
createPanelBorder()
Use this method to create a simple panel
Border which looks native on the current Look and Feel. |
static Border |
createTitledBorder(String title)
Use this method to create a Titled Border which looks native on the current Look and Feel.
|
static void |
equalizeSize(JComponent... components)
Resizes the given components making them equal in size.
|
static Color |
getErrorColor() |
static Color |
getInfoColor() |
static float |
getSmallFontSize() |
static Color |
getSuccessColor() |
static Color |
getWarnColor() |
static boolean |
isAquaLAF() |
static boolean |
isMac()
Returns true if the current operating system is Mac OS X.
|
static boolean |
isNimbusLAF() |
static boolean |
isWindows()
Returns true if the current operating system is any modern Windows distribution.
|
static boolean |
isWinLAF() |
static void |
setDefaultOkCancelKeyStrokes(JRootPane rootPane,
Action okAction,
Action cancelAction)
Maps the standard key strokes (usually ENTER and ESCAPE) to the passed OK and/or Cancel actions.
|
public static boolean isAquaLAF()
public static boolean isNimbusLAF()
public static boolean isWinLAF()
public static Color getInfoColor()
public static Color getWarnColor()
public static Color getErrorColor()
public static Color getSuccessColor()
public static float getSmallFontSize()
public static Border createPanelBorder()
Border
which looks native on the current Look and Feel.Border
for the current Look and Feel.public static Border createTitledBorder(String title)
BorderFactory.createTitledBorder(String)
does not look good on the "Aqua" Look and Feel (Mac OS X).Border
for the current Look and Feel.public static JPanel createOkCancelPanel(JButton okBtn, JButton cancelBtn)
okBtn
- The button that executes the main action. It can be null.cancelBtn
- The button that cancels the action (or simply closes a dialog). It can be null.JPanel
which contains the passed buttons.public static JPanel createOkCancelPanel(JButton okBtn, JButton cancelBtn, JComponent... otherComponents)
okBtn
- The button that executes the main action. It can be null.cancelBtn
- The button that cancels the action (or simply closes a dialog). It can be null.otherComponents
- Any other components to be included in the panel, such as check-boxes or other buttons.JPanel
which contains the passed components.public static void setDefaultOkCancelKeyStrokes(JRootPane rootPane, Action okAction, Action cancelAction)
public static void equalizeSize(JComponent... components)
public static boolean isMac()
public static boolean isWindows()
Copyright 2011-2015 Cytoscape Consortium. All rights reserved.