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 JButton |
createHelpButton(String helpStr) |
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 JPanel |
createOkCancelPanel(JButton okBtn,
JButton cancelBtn,
String helpStr)
Use this method to create OK, Cancel and Help
|
static JPanel |
createOkCancelPanel(JButton okBtn,
JButton cancelBtn,
String helpStr,
JComponent... otherComponents)
Use this method to include a help button in the bottom left corner.
|
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 |
makeSmall(JComponent... components)
If one of the components is a
JSlider , make sure this method is called after the slider has been added to
its parent container and had its UI assigned, otherwise it will have no effect on the slider's labels. |
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, String helpStr)
helpStr
- can be a full url, a lookup, or a help page namepublic 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 JPanel createOkCancelPanel(JButton okBtn, JButton cancelBtn, String helpStr, JComponent... otherComponents)
helpStr
- can be a full url, a lookup, or a help page namepublic static void setDefaultOkCancelKeyStrokes(JRootPane rootPane, Action okAction, Action cancelAction)
public static void equalizeSize(JComponent... components)
public static void makeSmall(JComponent... components)
JSlider
, make sure this method is called after the slider has been added to
its parent container and had its UI assigned, otherwise it will have no effect on the slider's labels.public static boolean isMac()
public static boolean isWindows()
Copyright 2011-2015 Cytoscape Consortium. All rights reserved.