public class TUIManager
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static java.lang.Object |
get(java.lang.String key)
Gets default value by a property key.
|
static Generator |
getAlarmColorGenerator()
Gets the default alarm color generator for network component.
|
static Generator |
getAlarmLabelGenerator()
Gets the default alarm label generator for network componet.
|
static java.lang.Object |
getAttachmentInfo(java.lang.String name)
Get attachment info by specified attachment name
|
static PositionStruct |
getAttachmentPosition(java.lang.String name)
Get attachment position struct by specified attachment name
|
static BlinkingRule |
getBlinkingRule()
Gets the default blinking rule for network component.
|
static boolean |
getBoolean(java.lang.String key)
Gets a default boolean value by a property key name.
|
static javax.swing.border.Border |
getBorder(java.lang.String key)
Gets a default border value by a property key name.
|
static javax.swing.Icon |
getCollapsedIcon()
Gets the default collapsed icon for tree components.
|
static java.awt.Color |
getColor(java.lang.String key)
Gets a default color value by a property key name.
|
static java.util.Comparator |
getComparator(java.lang.String key)
Gets a default comparator value by a property key name.
|
static java.awt.Font |
getDefault10SizeFont()
Gets twaver default 10 size font.
|
static java.awt.Font |
getDefaultBoldFont()
Gets twaver default bold font.
|
static java.awt.Font |
getDefaultFont()
Gets twaver default font.
|
static java.awt.Font |
getDefaultItalicBoldFont()
Gets twaver default italic and bold font.
|
static java.awt.Font |
getDefaultItalicFont()
Gets twaver default italic font.
|
static java.util.Iterator |
getDefaultkeys()
Returns all keys for defined defaults.
|
static java.awt.Font |
getDefaultPlainFont()
Gets twaver default plain font.
|
static java.awt.Dimension |
getDimension(java.lang.String key)
Gets a default dimension value by a property key name.
|
static Direction |
getDirection(java.lang.String key)
Gets a default direction value by a property key name.
|
static double |
getDouble(java.lang.String key)
Gets a default double value by a property key name.
|
static Generator |
getElementBodyColorGenerator()
Gets the default element body color generator.
|
static Generator |
getElementBodyCustomAttributeGenerator() |
static Generator |
getElementHeadCustomAttributeGenerator()
Gets the default element's web custom attribute generator.
|
static Generator |
getElementNetworkLabelGenerator()
Gets the element label generator for network components.
|
static Generator |
getElementStateOutlineColorGenerator()
Gets the default element state outline color generator.
|
static Generator |
getElementToolTipTextGenerator()
Gets the default element tooltip text generator.
|
static Generator |
getElementTreeLabelGenerator()
Gets the default element label generator for tree components.
|
static javax.swing.Icon |
getExpandedIcon()
Gets the default expanded icon for tree components.
|
static float |
getFloat(java.lang.String key)
Gets a default float value by a property key name.
|
static FloatInsets |
getFloatInsets(java.lang.String key)
Gets a default float insets value by a property key name.
|
static java.awt.Font |
getFont(java.lang.String key)
Gets a default font value by a property key name.
|
static javax.swing.ImageIcon |
getIcon(java.lang.Class clazz)
Gets element icon via element class type.
|
static javax.swing.Icon |
getIcon(java.lang.String key)
Gets a default icon value by a property key name.
|
static java.util.Iterator |
getIconkeys()
Gets keys of all registered element icons.
|
static java.lang.String |
getIconUrl(java.lang.Class clazz)
Gets element icon url by an element class type.
|
static javax.swing.ImageIcon |
getImage(java.lang.Class clazz)
Gets element image via element class type.
|
static java.util.Iterator |
getImageKeys()
Gets keys of all registered element images.
|
static java.lang.String |
getImageUrl(java.lang.Class clazz)
Gets element image url by an element class type.
|
static java.awt.Insets |
getInsets(java.lang.String key)
Gets a default insets value by a property key name.
|
static int |
getInt(java.lang.String key)
Gets a default int value by a property key name.
|
static Generator |
getLinkBundleAgentGenerator()
Gets default link bundle agent generator.
|
static VisibleFilter |
getLinkBundleFilter()
Gets the default link bundle filter for data box.
|
static LinkStyleFactory |
getLinkStyleFactory(java.lang.String linkStyle)
Gets the LinkStyleFactory by link style type.
|
static java.util.List |
getList(java.lang.String key)
Gets a default list value by a property key name.
|
static java.util.Map |
getMap(java.lang.String key)
Gets a default map value by a property key name.
|
static java.text.NumberFormat |
getNumberFormat(java.lang.String key)
Gets a default number format value by a property key name.
|
static java.awt.Color |
getPanelBackground()
Gets the default background color for JPanel components.
|
static PopupMenuGenerator |
getPopupMenuGenerator(java.lang.String key)
Gets a default popup menu factory value by a property key name.
|
static java.util.Iterator |
getPredefinedClientPropertyKeys()
Returns all keys for defined client property defaults.
|
static java.util.Iterator |
getPredefinedJavabeanNames()
Returns a Iterator for all predefined javabean name.
|
static java.awt.Shape |
getShape(java.lang.String key)
Gets a default shape value by a property key name.
|
static java.lang.String |
getString(java.lang.String key)
Gets a default string value by a property key name.
|
static java.awt.Stroke |
getStroke(java.lang.String key)
Gets a default stroke value by a property key name.
|
static java.awt.Stroke |
getStrokeByType(java.lang.String type)
Gets registered stroke object by a type string.
|
static java.util.Iterator |
getStrokeTypes()
Retrieve types for all registered stroke objects.
|
static java.lang.String |
getTableCellEditor(java.lang.Class valueClass)
Gets registered table cell editor for given cell value type.
|
static java.util.Iterator |
getTableCellEditorKeys()
Gets all keys of the registered cell editors.
|
static java.lang.String |
getTableCellRenderer(java.lang.Class valueClass)
Gets registered table cell renderer for given cell value type.
|
static java.util.Iterator |
getTableCellRendererKeys()
Gets all keys of the registered cell renderers.
|
static boolean |
isPredefinedClientPropertyKey(java.lang.String clientPropertyKey)
Return true if the given property name is a predefined
client property key name, false otherwise.
|
static boolean |
isPredefinedJavabeanName(java.lang.String javaBeanName)
Checks whether the given property name is a predefined javabean name.
|
static boolean |
isPredefinedPropertyCopied(java.lang.String propertyName)
Determines whether the specified predefined property name should be copied or not.
|
static void |
registerAttachment(java.lang.String name,
java.lang.Class clazz)
Registers new attachment for TWaver.
|
static void |
registerAttachment(java.lang.String name,
java.lang.Class clazz,
int position)
Registers new attachment for TWaver.
|
static void |
registerAttachment(java.lang.String name,
java.lang.Class clazz,
int position,
int xOffset,
int yOffset)
Registers new attachment for TWaver.
|
static void |
registerAttachment(java.lang.String name,
java.lang.String iconURL)
Registers new attachment for TWaver.
|
static void |
registerAttachment(java.lang.String name,
java.lang.String iconURL,
int position)
Registers new attachment for TWaver.
|
static void |
registerAttachment(java.lang.String name,
java.lang.String iconURL,
int position,
int xOffset,
int yOffset)
Registers new attachment for TWaver.
|
static void |
registerDefault(java.lang.String key,
java.lang.Object value)
Registers the default value by the property key.
|
static void |
registerIcon(java.lang.Class elementClass,
java.lang.String url)
Registers default icon url for an element type.
|
static void |
registerImage(java.lang.Class elementClass,
java.lang.String url)
Registers default image url for an element type.
|
static void |
registerLinkStyle(java.lang.String linkStyle,
LinkStyleFactory linkStyleFactory)
Registers a new LinkStyleFactory with the specified link style type.
|
static void |
registerPredefinedPropertyCopied(java.lang.String propertyName,
boolean copyOrNot)
Registers to determines whether the specified predefined property name should be copied or not.
|
static void |
registerStroke(java.lang.String type,
java.awt.Stroke stroke)
Registers a stroke object into TWaver with a type string.
|
static void |
registerTableCellEditor(java.lang.Class valueClass,
java.lang.Class editorClass)
Registers a table cell editor for a class type
|
static void |
registerTableCellEditor(java.lang.Class valueClass,
java.lang.String editorClass)
Registers a table cell editor for a class type
|
static void |
registerTableCellRenderer(java.lang.Class valueClass,
java.lang.Class rendererClass)
Registers a table cell renderer for a class type.
|
static void |
registerTableCellRenderer(java.lang.Class valueClass,
java.lang.String rendererClass)
Registers a table cell renderer for a class type.
|
static void |
registerWithoutImage(java.lang.Class elementClass)
Calls the method to tell twaver the element type has no image,
normally this kind of element is drawn be Java2D.
|
static void |
setAlarmColorGenerator(Generator alarmColorGenerator)
Sets a new default alarm color generator for network component.
|
static void |
setAlarmLabelGenerator(Generator alarmLabelGenerator)
Sets a new default alarm label generator for network component.
|
static void |
setBlinkingRule(BlinkingRule blinkingRule)
Sets the default blinking rule for network component.
|
static void |
setDefaultFont(java.awt.Font font)
Sets a new twaver default font, Default font is used in network canvas,
such as label attachment of element, etc.
|
static void |
setElementBodyColorGenerator(Generator elementBodyColorGenerator)
Sets the default element body color generator.
|
static void |
setElementBodyCustomAttributeGenerator(Generator elementBodyAttributeGenerator) |
static void |
setElementHeadCustomAttributeGenerator(Generator customAttributeGenerator)
Sets the default element's web custom attribute generator.
|
static void |
setElementNetworkLabelGenerator(Generator networkElementLabelGenerator)
Sets the element label generator for all network components.
|
static void |
setElementStateOutlineColorGenerator(Generator elementOutlineColorGenerator)
Sets the default element state outline color generator.
|
static void |
setElementToolTipTextGenerator(Generator elementToolTipTextGenerator)
Sets the default element tooltip text generator.
|
static void |
setElementTreeLabelGenerator(Generator treeElementLabelGenerator)
Sets the default element label generator for tree components.
|
static void |
setLinkBundleAgentGenerator(Generator linkBundleAgentGenerator)
Sets link bundle agent generator.
|
static void |
setLinkBundleFilter(VisibleFilter linkBundleFilter)
Sets the default link bundle filter for data box.
|
static void |
updateDefaultFont()
Updates the default font of twaver from javax.swing.UIManager#.getFont("Label.font")
Normally user dosen't need to call this method.
|
public static void registerPredefinedPropertyCopied(java.lang.String propertyName, boolean copyOrNot)
Predefined properties mean:
TWaverConst.PROPERTYNAME_* for specified java bean/client property;
TWaverConst.ALL_CLIENTPROPERTIES for all client properties;
TWaverConst.ALL_USERPROPERTIES for
all user properties; TWaverConst.ELEMENT_STATE_ICON_PREFIX for attachments.
By default all predefined properties will be copied except for:
TWaverConst.PROPERTYNAME_CHILDREN
TWaverConst.PROPERTYNAME_PARENT
TWaverConst.PROPERTYNAME_HOST
TWaverConst.PROPERTYNAME_BUSINESSOBJECT
TWaverConst.ELEMENT_STATE_ICON_PREFIX
TWaverConst.ALL_CLIENTPROPERTIES
TWaverConst.ALL_USERPROPERTIES
propertyName
- the specified predefined property name to be registered.copyOrNot
- True to copy, false do nothing.isPredefinedPropertyCopied(String)
,
Element.copy()
,
ExportValuesInterceptor
,
DefaultExportValuesInterceptor
public static boolean isPredefinedPropertyCopied(java.lang.String propertyName)
Predefined properties mean:
TWaverConst.PROPERTYNAME_* for specified java bean/client property;
TWaverConst.ALL_CLIENTPROPERTIES for all client properties;
TWaverConst.ALL_USERPROPERTIES for
all user properties; TWaverConst.ELEMENT_STATE_ICON_PREFIX for attachments.
By default all predefined properties will be copied except for:
TWaverConst.PROPERTYNAME_CHILDREN
TWaverConst.PROPERTYNAME_PARENT
TWaverConst.PROPERTYNAME_HOST
TWaverConst.PROPERTYNAME_BUSINESSOBJECT
TWaverConst.ELEMENT_STATE_ICON_PREFIX
TWaverConst.ALL_CLIENTPROPERTIES
TWaverConst.ALL_USERPROPERTIES
propertyName
- the specified predefined property name to be checked.registerPredefinedPropertyCopied(String, boolean)
public static java.util.Iterator getPredefinedJavabeanNames()
public static boolean isPredefinedJavabeanName(java.lang.String javaBeanName)
javaBeanName
- the given property name to be checked.public static java.util.Iterator getPredefinedClientPropertyKeys()
public static boolean isPredefinedClientPropertyKey(java.lang.String clientPropertyKey)
propertyName
- String property key namepublic static void updateDefaultFont()
UIManager
automatically.
Default font is used in network canvas, such as label attachment of element, etc. If you want to use other font different from lookAndFeel, you can call #setDefaultFont(Font).
public static void setDefaultFont(java.awt.Font font)
font
- the new twaver default fontupdateDefaultFont()
public static java.awt.Font getDefaultFont()
setDefaultFont(Font)
public static java.awt.Font getDefaultBoldFont()
setDefaultFont(Font)
public static java.awt.Font getDefaultPlainFont()
setDefaultFont(Font)
public static java.awt.Font getDefaultItalicFont()
setDefaultFont(Font)
public static java.awt.Font getDefaultItalicBoldFont()
setDefaultFont(Font)
public static java.awt.Font getDefault10SizeFont()
setDefaultFont(Font)
public static java.util.Iterator getDefaultkeys()
public static void registerDefault(java.lang.String key, java.lang.Object value)
key
- the property key namevalue
- the default value for the key bound propertypublic static java.lang.Object get(java.lang.String key)
key
- the property key namepublic static java.awt.Font getFont(java.lang.String key)
key
- the property key namepublic static java.awt.Shape getShape(java.lang.String key)
key
- the property key namepublic static java.util.Map getMap(java.lang.String key)
key
- the property key namepublic static java.awt.Color getColor(java.lang.String key)
key
- the property key namepublic static boolean getBoolean(java.lang.String key)
key
- the property key namepublic static java.util.Comparator getComparator(java.lang.String key)
key
- the property key namepublic static java.util.List getList(java.lang.String key)
key
- the property key namepublic static java.text.NumberFormat getNumberFormat(java.lang.String key)
key
- the property key namepublic static PopupMenuGenerator getPopupMenuGenerator(java.lang.String key)
key
- the property key namepublic static int getInt(java.lang.String key)
key
- the property key namepublic static float getFloat(java.lang.String key)
key
- the property key namepublic static double getDouble(java.lang.String key)
key
- the property key namepublic static javax.swing.border.Border getBorder(java.lang.String key)
key
- the property key namepublic static javax.swing.Icon getIcon(java.lang.String key)
key
- the property key namepublic static java.awt.Insets getInsets(java.lang.String key)
key
- the property key namepublic static FloatInsets getFloatInsets(java.lang.String key)
key
- the property key namepublic static java.awt.Dimension getDimension(java.lang.String key)
key
- the property key namepublic static java.lang.String getString(java.lang.String key)
key
- the property key namepublic static java.awt.Stroke getStroke(java.lang.String key)
key
- the property key namepublic static Direction getDirection(java.lang.String key)
key
- the property key namepublic static javax.swing.ImageIcon getIcon(java.lang.Class clazz)
clazz
- element class typegetImage(Class)
public static javax.swing.ImageIcon getImage(java.lang.Class clazz)
clazz
- element class typegetIcon(java.lang.String)
public static java.lang.String getIconUrl(java.lang.Class clazz)
clazz
- element class typegetImageUrl(java.lang.Class)
public static java.lang.String getImageUrl(java.lang.Class clazz)
clazz
- element class typegetIconUrl(java.lang.Class)
public static void registerIcon(java.lang.Class elementClass, java.lang.String url)
elementClass
- element class typeurl
- element icon url stringpublic static void registerImage(java.lang.Class elementClass, java.lang.String url)
elementClass
- element class typeurl
- element image url stringpublic static void registerWithoutImage(java.lang.Class elementClass)
Notice this method will effects result of twaver.network.ui.ElementUI#contains(int, int)
elementClass
- public static java.util.Iterator getIconkeys()
java.lang.Class
, the element class type. The
value of the key is icon url string.
TWaver use this way to save all registered icons:
iconMapper.put(Node.class, "/resource/image/twaver/node_icon.png");
public static java.util.Iterator getImageKeys()
java.lang.Class
, the element class type. The
value of the key is image url string.
TWaver use this way to save all registered images:
imageMapper.put(Node.class, "/resource/image/twaver/node_image.png");
public static java.lang.String getTableCellRenderer(java.lang.Class valueClass)
valueClass
- a class type for table cell value.public static java.lang.String getTableCellEditor(java.lang.Class valueClass)
valueClass
- a class type for table cell value.public static void registerTableCellRenderer(java.lang.Class valueClass, java.lang.String rendererClass)
valueClass
- the class type of valuerendererClass
- fully qualified name of table renderer class.public static void registerTableCellRenderer(java.lang.Class valueClass, java.lang.Class rendererClass)
valueClass
- the class type of valuerendererClass
- the class of table rendererpublic static void registerTableCellEditor(java.lang.Class valueClass, java.lang.String editorClass)
valueClass
- the class type of valueeditorClass
- fully qualified name of table editor class.public static void registerTableCellEditor(java.lang.Class valueClass, java.lang.Class editorClass)
valueClass
- the class type of valueeditorClass
- the class of table editorpublic static java.util.Iterator getTableCellRendererKeys()
java.lang.Class
, refer
to the bound value's class type.public static java.util.Iterator getTableCellEditorKeys()
java.lang.Class
, refer
to the bound value's class type.public static Generator getElementNetworkLabelGenerator()
TNetwork.getElementLabelGenerator()
public static void setElementNetworkLabelGenerator(Generator networkElementLabelGenerator)
networkElementLabelGenerator
- the new label generatorTNetwork.setElementLabelGenerator(Generator)
public static Generator getElementTreeLabelGenerator()
TTree.getElementLabelGenerator()
public static void setElementTreeLabelGenerator(Generator treeElementLabelGenerator)
treeElementLabelGenerator
- the default element label generator for tree components.TTree.setElementToolTipTextGenerator(Generator)
public static Generator getElementToolTipTextGenerator()
TNetwork.getElementToolTipTextGenerator()
,
TTree.getElementToolTipTextGenerator()
public static void setElementToolTipTextGenerator(Generator elementToolTipTextGenerator)
elementToolTipTextGenerator
- the default element tooltip text generator.TNetwork.setElementToolTipTextGenerator(Generator)
,
TTree.setElementToolTipTextGenerator(Generator)
public static BlinkingRule getBlinkingRule()
TNetwork.setBlinkingRule(BlinkingRule)
public static void setBlinkingRule(BlinkingRule blinkingRule)
blinkingRule
- the default blinking rule.TNetwork.setBlinkingRule(BlinkingRule)
public static VisibleFilter getLinkBundleFilter()
TDataBox.getLinkBundleFilter()
public static void setLinkBundleFilter(VisibleFilter linkBundleFilter)
linkBundleFilter
- a new default link bundle filter for data box.TDataBox.setLinkBundleFilter(VisibleFilter)
public static Generator getLinkBundleAgentGenerator()
TDataBox.getLinkBundleAgentGenerator()
public static void setLinkBundleAgentGenerator(Generator linkBundleAgentGenerator)
linkBundleAgentGenerator
- the default link bundle agent generator.TDataBox.setLinkBundleAgentGenerator(Generator)
public static Generator getElementStateOutlineColorGenerator()
TNetwork.getElementStateOutlineColorGenerator()
,
TTree.getElementStateOutlineColorGenerator()
public static void setElementStateOutlineColorGenerator(Generator elementOutlineColorGenerator)
elementStateOutlineColorGenerator
- a new default element state outline color generatorTNetwork.setElementStateOutlineColorGenerator(Generator)
,
TTree.setElementStateOutlineColorGenerator(Generator)
public static Generator getElementBodyColorGenerator()
TNetwork.getElementBodyColorGenerator()
,
TTree.getElementBodyColorGenerator()
public static void setElementBodyColorGenerator(Generator elementBodyColorGenerator)
elementBodyColorGenerator
- the new default element body color generator.TNetwork.setElementBodyColorGenerator(Generator)
,
TTree.setElementBodyColorGenerator(Generator)
public static javax.swing.Icon getExpandedIcon()
public static javax.swing.Icon getCollapsedIcon()
public static java.awt.Color getPanelBackground()
public static Generator getAlarmLabelGenerator()
TNetwork.getAlarmLabelGenerator()
public static void setAlarmLabelGenerator(Generator alarmLabelGenerator)
alarmLabelGenerator
- a new default alarm label generator for network component.TNetwork.setAlarmLabelGenerator(Generator)
public static Generator getAlarmColorGenerator()
TNetwork.getAlarmColorGenerator()
public static void setAlarmColorGenerator(Generator alarmColorGenerator)
alarmLabelGenerator
- a new default alarm color generator for network component.TNetwork.setAlarmColorGenerator(Generator)
public static Generator getElementHeadCustomAttributeGenerator()
public static void setElementHeadCustomAttributeGenerator(Generator customAttributeGenerator)
elementBodyColorGenerator
- the new default element's web custom attribute generator.public static Generator getElementBodyCustomAttributeGenerator()
public static void setElementBodyCustomAttributeGenerator(Generator elementBodyAttributeGenerator)
public static java.lang.Object getAttachmentInfo(java.lang.String name)
name
- the attachment namepublic static PositionStruct getAttachmentPosition(java.lang.String name)
name
- the attachment namepublic static void registerAttachment(java.lang.String name, java.lang.String iconURL)
name
- the attachment name.iconURL
- the attachment icon's url.public static void registerAttachment(java.lang.String name, java.lang.String iconURL, int position)
name
- the attachment name.iconURL
- the attachment icon's url.position
- the attachment position.public static void registerAttachment(java.lang.String name, java.lang.String iconURL, int position, int xOffset, int yOffset)
name
- the attachment name.iconURL
- the attachment icon's url.position
- the attachment position.xOffset
- the x offset.xOffset
- the y offset.public static void registerAttachment(java.lang.String name, java.lang.Class clazz)
name
- the attachment name.clazz
- the attahchment's class, a new attachment instance
will be created by the class's new newInstance method
with ElementUI and TNetwork parameters.public static void registerAttachment(java.lang.String name, java.lang.Class clazz, int position)
name
- the attachment name.clazz
- the attahchment's class.position
- the attachment position.public static void registerAttachment(java.lang.String name, java.lang.Class clazz, int position, int xOffset, int yOffset)
name
- the attachment name.clazz
- the attahchment's class.position
- the attachment position.xOffset
- the x offset.xOffset
- the y offset.public static java.awt.Stroke getStrokeByType(java.lang.String type)
type
- string of the stroke typepublic static void registerStroke(java.lang.String type, java.awt.Stroke stroke)
type
- string of the stroke typestroke
- the stroke object of the given typepublic static java.util.Iterator getStrokeTypes()
public static LinkStyleFactory getLinkStyleFactory(java.lang.String linkStyle)
linkStyle
- the link style typepublic static void registerLinkStyle(java.lang.String linkStyle, LinkStyleFactory linkStyleFactory)
linkStyle
- the link style typelinkStyleFactory
- a new LinkStyleFactory instanceCopyright © 2002 - 2010 Serva Software. All Rights Reserved.