A typesafe enumeration of colors that can be fetched from a style.
Each SynthStyle has a set of ColorTypes that are accessed by way of the SynthStyle.getColor(SynthContext, ColorType) method. SynthStyle's installDefaults will install the FOREGROUND color as the foreground of the Component, and the BACKGROUND color to the background of the component (assuming that you have not explicitly specified a foreground and background color). Some components support more color based properties, for example JList has the property selectionForeground which will be mapped to FOREGROUND with a component state of SynthConstants.SELECTED.
The following example shows a custom SynthStyle that returns a red Color for the DISABLED state, otherwise a black color.
class MyStyle extends SynthStyle { private Color disabledColor = new ColorUIResource(Color.RED); private Color color = new ColorUIResource(Color.BLACK); protected Color getColorForState(SynthContext context, ColorType type){ if (context.getComponentState() == SynthConstants.DISABLED) { return disabledColor; } return color; } }
A typesafe enumeration of colors that can be fetched from a style. Each SynthStyle has a set of ColorTypes that are accessed by way of the SynthStyle.getColor(SynthContext, ColorType) method. SynthStyle's installDefaults will install the FOREGROUND color as the foreground of the Component, and the BACKGROUND color to the background of the component (assuming that you have not explicitly specified a foreground and background color). Some components support more color based properties, for example JList has the property selectionForeground which will be mapped to FOREGROUND with a component state of SynthConstants.SELECTED. The following example shows a custom SynthStyle that returns a red Color for the DISABLED state, otherwise a black color. class MyStyle extends SynthStyle { private Color disabledColor = new ColorUIResource(Color.RED); private Color color = new ColorUIResource(Color.BLACK); protected Color getColorForState(SynthContext context, ColorType type){ if (context.getComponentState() == SynthConstants.DISABLED) { return disabledColor; } return color; } }
No vars found in this namespace.
A distinct rendering area of a Swing component. A component may support one or more regions. Specific component regions are defined by the typesafe enumeration in this class.
Regions are typically used as a way to identify the Components and areas a particular style is to apply to. Synth's file format allows you to bind styles based on the name of a Region. The name is derived from the field name of the constant:
Map all characters to lowercase. Map the first character to uppercase. Map the first character after underscores to uppercase. Remove all underscores.
For example, to identify the SPLIT_PANE Region you would use SplitPane. The following shows a custom SynthStyleFactory that returns a specific style for split panes:
public SynthStyle getStyle(JComponent c, Region id) { if (id == Region.SPLIT_PANE) { return splitPaneStyle; } ... } The following xml accomplishes the same thing:
<style id="splitPaneStyle"> ... </style>
<bind style="splitPaneStyle" type="region" key="SplitPane"/>
A distinct rendering area of a Swing component. A component may support one or more regions. Specific component regions are defined by the typesafe enumeration in this class. Regions are typically used as a way to identify the Components and areas a particular style is to apply to. Synth's file format allows you to bind styles based on the name of a Region. The name is derived from the field name of the constant: Map all characters to lowercase. Map the first character to uppercase. Map the first character after underscores to uppercase. Remove all underscores. For example, to identify the SPLIT_PANE Region you would use SplitPane. The following shows a custom SynthStyleFactory that returns a specific style for split panes: public SynthStyle getStyle(JComponent c, Region id) { if (id == Region.SPLIT_PANE) { return splitPaneStyle; } ... } The following xml accomplishes the same thing: <style id="splitPaneStyle"> ... </style> <bind style="splitPaneStyle" type="region" key="SplitPane"/>
Provides the Synth L&F UI delegate for JButton.
Provides the Synth L&F UI delegate for JButton.
Provides the Synth L&F UI delegate for JCheckBoxMenuItem.
Provides the Synth L&F UI delegate for JCheckBoxMenuItem.
Provides the Synth L&F UI delegate for JCheckBox.
Provides the Synth L&F UI delegate for JCheckBox.
Provides the Synth L&F UI delegate for JColorChooser.
Provides the Synth L&F UI delegate for JColorChooser.
Provides the Synth L&F UI delegate for JComboBox.
Provides the Synth L&F UI delegate for JComboBox.
Constants used by Synth. Not all Components support all states. A Component will at least be in one of the primary states. That is, the return value from SynthContext.getComponentState() will at least be one of ENABLED, MOUSE_OVER, PRESSED or DISABLED, and may also contain FOCUSED, SELECTED or DEFAULT.
Constants used by Synth. Not all Components support all states. A Component will at least be in one of the primary states. That is, the return value from SynthContext.getComponentState() will at least be one of ENABLED, MOUSE_OVER, PRESSED or DISABLED, and may also contain FOCUSED, SELECTED or DEFAULT.
No vars found in this namespace.
An immutable transient object containing contextual information about a Region. A SynthContext should only be considered valid for the duration of the method it is passed to. In other words you should not cache a SynthContext that is passed to you and expect it to remain valid.
An immutable transient object containing contextual information about a Region. A SynthContext should only be considered valid for the duration of the method it is passed to. In other words you should not cache a SynthContext that is passed to you and expect it to remain valid.
Provides the Synth L&F UI delegate for a minimized internal frame on a desktop.
Provides the Synth L&F UI delegate for a minimized internal frame on a desktop.
Provides the Synth L&F UI delegate for JDesktopPane.
Provides the Synth L&F UI delegate for JDesktopPane.
Provides the Synth L&F UI delegate for JEditorPane.
Provides the Synth L&F UI delegate for JEditorPane.
Provides the Synth L&F UI delegate for JFormattedTextField.
Provides the Synth L&F UI delegate for JFormattedTextField.
Wrapper for primitive graphics calls.
Wrapper for primitive graphics calls.
Provides the Synth L&F UI delegate for JInternalFrame.
Provides the Synth L&F UI delegate for JInternalFrame.
Provides the Synth L&F UI delegate for JLabel.
Provides the Synth L&F UI delegate for JLabel.
Provides the Synth L&F UI delegate for JList.
Provides the Synth L&F UI delegate for JList.
SynthLookAndFeel provides the basis for creating a customized look and feel. SynthLookAndFeel does not directly provide a look, all painting is delegated. You need to either provide a configuration file, by way of the load(java.io.InputStream, java.lang.Class<?>) method, or provide your own SynthStyleFactory to setStyleFactory(javax.swing.plaf.synth.SynthStyleFactory). Refer to the package summary for an example of loading a file, and SynthStyleFactory for an example of providing your own SynthStyleFactory to setStyleFactory.
Warning: This class implements Serializable as a side effect of it extending BasicLookAndFeel. It is not intended to be serialized. An attempt to serialize it will result in NotSerializableException.
SynthLookAndFeel provides the basis for creating a customized look and feel. SynthLookAndFeel does not directly provide a look, all painting is delegated. You need to either provide a configuration file, by way of the load(java.io.InputStream, java.lang.Class<?>) method, or provide your own SynthStyleFactory to setStyleFactory(javax.swing.plaf.synth.SynthStyleFactory). Refer to the package summary for an example of loading a file, and SynthStyleFactory for an example of providing your own SynthStyleFactory to setStyleFactory. Warning: This class implements Serializable as a side effect of it extending BasicLookAndFeel. It is not intended to be serialized. An attempt to serialize it will result in NotSerializableException.
Provides the Synth L&F UI delegate for JMenuBar.
Provides the Synth L&F UI delegate for JMenuBar.
Provides the Synth L&F UI delegate for JMenuItem.
Provides the Synth L&F UI delegate for JMenuItem.
Provides the Synth L&F UI delegate for JMenu.
Provides the Synth L&F UI delegate for JMenu.
Provides the Synth L&F UI delegate for JOptionPane.
Provides the Synth L&F UI delegate for JOptionPane.
SynthPainter is used for painting portions of JComponents. At a minimum each JComponent has two paint methods: one for the border and one for the background. Some JComponents have more than one Region, and as a consequence more paint methods.
Instances of SynthPainter are obtained from the SynthStyle.getPainter(javax.swing.plaf.synth.SynthContext) method.
You typically supply a SynthPainter by way of Synth's file format. The following example registers a painter for all JButtons that will render the image myImage.png:
<style id="buttonStyle"> <imagePainter path="myImage.png" sourceInsets="2 2 2 2" paintCenter="true" stretch="true"/> <insets top="2" bottom="2" left="2" right="2"/> </style>
<bind style="buttonStyle" type="REGION" key="button"/>
SynthPainter is abstract in so far as it does no painting, all the methods are empty. While none of these methods are typed to throw an exception, subclasses can assume that valid arguments are passed in, and if not they can throw a NullPointerException or IllegalArgumentException in response to invalid arguments.
SynthPainter is used for painting portions of JComponents. At a minimum each JComponent has two paint methods: one for the border and one for the background. Some JComponents have more than one Region, and as a consequence more paint methods. Instances of SynthPainter are obtained from the SynthStyle.getPainter(javax.swing.plaf.synth.SynthContext) method. You typically supply a SynthPainter by way of Synth's file format. The following example registers a painter for all JButtons that will render the image myImage.png: <style id="buttonStyle"> <imagePainter path="myImage.png" sourceInsets="2 2 2 2" paintCenter="true" stretch="true"/> <insets top="2" bottom="2" left="2" right="2"/> </style> <bind style="buttonStyle" type="REGION" key="button"/> SynthPainter is abstract in so far as it does no painting, all the methods are empty. While none of these methods are typed to throw an exception, subclasses can assume that valid arguments are passed in, and if not they can throw a NullPointerException or IllegalArgumentException in response to invalid arguments.
Provides the Synth L&F UI delegate for JPanel.
Provides the Synth L&F UI delegate for JPanel.
Provides the Synth L&F UI delegate for JPasswordField.
Provides the Synth L&F UI delegate for JPasswordField.
Provides the Synth L&F UI delegate for JPopupMenu.
Provides the Synth L&F UI delegate for JPopupMenu.
Provides the Synth L&F UI delegate for JProgressBar.
Provides the Synth L&F UI delegate for JProgressBar.
Provides the Synth L&F UI delegate for JRadioButtonMenuItem.
Provides the Synth L&F UI delegate for JRadioButtonMenuItem.
Provides the Synth L&F UI delegate for JRadioButton.
Provides the Synth L&F UI delegate for JRadioButton.
Provides the Synth L&F UI delegate for JRootPane.
Provides the Synth L&F UI delegate for JRootPane.
Provides the Synth L&F UI delegate for JScrollBar.
Provides the Synth L&F UI delegate for JScrollBar.
Provides the Synth L&F UI delegate for JScrollPane.
Provides the Synth L&F UI delegate for JScrollPane.
Provides the Synth L&F UI delegate for JSeparator.
Provides the Synth L&F UI delegate for JSeparator.
Provides the Synth L&F UI delegate for JSlider.
Provides the Synth L&F UI delegate for JSlider.
Provides the Synth L&F UI delegate for JSpinner.
Provides the Synth L&F UI delegate for JSpinner.
Provides the Synth L&F UI delegate for JSplitPane.
Provides the Synth L&F UI delegate for JSplitPane.
SynthStyle is a set of style properties. Each SynthUI references at least one SynthStyle that is obtained using a SynthStyleFactory. You typically don't need to interact with this class directly, rather you will load a Synth File Format file into SynthLookAndFeel that will create a set of SynthStyles.
SynthStyle is a set of style properties. Each SynthUI references at least one SynthStyle that is obtained using a SynthStyleFactory. You typically don't need to interact with this class directly, rather you will load a Synth File Format file into SynthLookAndFeel that will create a set of SynthStyles.
Factory used for obtaining SynthStyles. Each of the Synth ComponentUIs will call into the current SynthStyleFactory to obtain a SynthStyle for each of the distinct regions they have.
The following example creates a custom SynthStyleFactory that returns a different style based on the Region:
class MyStyleFactory extends SynthStyleFactory { public SynthStyle getStyle(JComponent c, Region id) { if (id == Region.BUTTON) { return buttonStyle; } else if (id == Region.TREE) { return treeStyle; } return defaultStyle; } } SynthLookAndFeel laf = new SynthLookAndFeel(); UIManager.setLookAndFeel(laf); SynthLookAndFeel.setStyleFactory(new MyStyleFactory());
Factory used for obtaining SynthStyles. Each of the Synth ComponentUIs will call into the current SynthStyleFactory to obtain a SynthStyle for each of the distinct regions they have. The following example creates a custom SynthStyleFactory that returns a different style based on the Region: class MyStyleFactory extends SynthStyleFactory { public SynthStyle getStyle(JComponent c, Region id) { if (id == Region.BUTTON) { return buttonStyle; } else if (id == Region.TREE) { return treeStyle; } return defaultStyle; } } SynthLookAndFeel laf = new SynthLookAndFeel(); UIManager.setLookAndFeel(laf); SynthLookAndFeel.setStyleFactory(new MyStyleFactory());
Provides the Synth L&F UI delegate for JTabbedPane.
Looks up the selectedTabPadInsets property from the Style, which represents additional insets for the selected tab.
Provides the Synth L&F UI delegate for JTabbedPane. Looks up the selectedTabPadInsets property from the Style, which represents additional insets for the selected tab.
Provides the Synth L&F UI delegate for JTableHeader.
Provides the Synth L&F UI delegate for JTableHeader.
Provides the Synth L&F UI delegate for JTable.
Provides the Synth L&F UI delegate for JTable.
Provides the look and feel for a plain text editor in the Synth look and feel. In this implementation the default UI is extended to act as a simple view factory.
Warning: Serialized objects of this class will not be compatible with future Swing releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of Swing. As of 1.4, support for long term storage of all JavaBeans™ has been added to the java.beans package. Please see XMLEncoder.
Provides the look and feel for a plain text editor in the Synth look and feel. In this implementation the default UI is extended to act as a simple view factory. Warning: Serialized objects of this class will not be compatible with future Swing releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of Swing. As of 1.4, support for long term storage of all JavaBeans™ has been added to the java.beans package. Please see XMLEncoder.
Provides the Synth L&F UI delegate for JTextField.
Warning: Serialized objects of this class will not be compatible with future Swing releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of Swing. As of 1.4, support for long term storage of all JavaBeans™ has been added to the java.beans package. Please see XMLEncoder.
Provides the Synth L&F UI delegate for JTextField. Warning: Serialized objects of this class will not be compatible with future Swing releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of Swing. As of 1.4, support for long term storage of all JavaBeans™ has been added to the java.beans package. Please see XMLEncoder.
Provides the look and feel for a styled text editor in the Synth look and feel.
Warning: Serialized objects of this class will not be compatible with future Swing releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of Swing. As of 1.4, support for long term storage of all JavaBeans™ has been added to the java.beans package. Please see XMLEncoder.
Provides the look and feel for a styled text editor in the Synth look and feel. Warning: Serialized objects of this class will not be compatible with future Swing releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of Swing. As of 1.4, support for long term storage of all JavaBeans™ has been added to the java.beans package. Please see XMLEncoder.
Provides the Synth L&F UI delegate for JToggleButton.
Provides the Synth L&F UI delegate for JToggleButton.
Provides the Synth L&F UI delegate for JToolBar.
Provides the Synth L&F UI delegate for JToolBar.
Provides the Synth L&F UI delegate for JToolTip.
Provides the Synth L&F UI delegate for JToolTip.
Provides the Synth L&F UI delegate for JTree.
Provides the Synth L&F UI delegate for JTree.
SynthUI is used to fetch the SynthContext for a particular Component.
SynthUI is used to fetch the SynthContext for a particular Component.
Provides the Synth L&F UI delegate for JViewport.
Provides the Synth L&F UI delegate for JViewport.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close