Package org.freeplane.core.ui.components
Class UITools
java.lang.Object
org.freeplane.core.ui.components.UITools
Utilities for accessing the GUI, creating dialogs etc.: In scripts available as "global variable"
ui.
In scripts this would be a simple way of opening a info popup:
ui.informationMessage("Hello World!")
ui.informationMessage(ui.frame, "Hello World!") // longer version, equivalent
- Since:
- 29.12.2008
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic final class -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddEscapeActionToDialog(JDialog dialog) static voidaddEscapeActionToDialog(JDialog dialog, Action action) static voidaddKeyActionToDialog(JDialog dialog, Action action, String keyStroke, String actionId) static voidaddScrollbarIncrementPropertyListener(JScrollPane scrollPane) static TitledBorderaddTitledBorder(JComponent c, String title, float size) static voidstatic voidconvertPointFromAncestor(Component ancestor, Point p, Component c) static voidconvertPointToAncestor(Component from, Point p, Component destination) static voidconvertPointToAncestor(Component source, Point point, Class<?> ancestorClass) static voidconvertRectangleToAncestor(Component from, Rectangle r, Component destination) static JDialogcreateCancelDialog(Component component, String title, String text) static JDialogcreateCancelDialog(Component component, String title, String text, String buttonText) static JButtoncreateHtmlLinkStyleButton(URI uri, String title) static BasicStrokecreateStroke(float width, int[] dash, int join) static voiderrorMessage(Object message) static voidexecuteWhenNodeHasFocus(Runnable runnable) static PointfindBestLocation(Component placedComponent, Component displayedComponent) static voidfocusOn(JComponent component) static Rectanglestatic final intgetComponentIndex(Component component) static Framestatic Componentstatic Fontstatic FramegetFrame()static JTabbedPanestatic KeyStrokegetKeyStroke(String keyStrokeDescription) returns a KeyStroke if possible and null otherwise.static Componentstatic RectanglegetScreenBounds(GraphicsConfiguration graphicsConfiguration) static ColorgetTextColorForBackground(Color color) static Fontstatic FontgetUIFont(float scalingFactor) static intgetUIFontSize(double scalingFactor) static intgetUIFontSize(float scalingFactor) static RectanglegetValidFrameBounds(Component frame, int win_x, int win_y, int win_width, int win_height) static voidinformationMessage(Component frame, Object message) static voidinformationMessage(Component frame, Object message, String title) static voidinformationMessage(Component frame, Object text, String title, int type) static voidinformationMessage(Object message) static FontinvertScale(Font font) static booleanstatic booleanstatic booleanstatic booleanstatic StringkeyStrokeToString(KeyStroke keyStroke) formats a KeyStroke in a ledgible way, e.g.static JFileChooserstatic JFileChoosernewFileChooser(File directory) static voidrepaintAll(Container root) static Fontstatic FontscaleFontInt(Font font, double additionalFactor) static Fontstatic voidstatic voidsetDialogLocationRelativeTo(JDialog dialog, Component c) static voidsetDialogLocationRelativeTo(JDialog dialog, org.freeplane.features.map.NodeModel node) static voidsetDialogLocationUnder(JDialog dialog, org.freeplane.features.map.NodeModel node) static voidsetScrollbarIncrement(JScrollPane scrollPane) static voidShows the error message "attributes_adding_empty_attribute_error"static intshowConfirmDialog(org.freeplane.features.map.NodeModel node, Object message, String title, int optionType) static intshowConfirmDialog(org.freeplane.features.map.NodeModel node, Object message, String title, int optionType, int messageType) static voidstatic StringshowInputDialog(org.freeplane.features.map.NodeModel node, String message, String initialValue) static StringshowInputDialog(org.freeplane.features.map.NodeModel node, String text, String title, int type) static voidshowMessage(String message, int messageType)
-
Field Details
-
MAIN_FREEPLANE_FRAME
- See Also:
-
SCROLLBAR_INCREMENT
- See Also:
-
MAX_BUTTON_DIMENSION
-
FONT_SCALE_FACTOR
public static final float FONT_SCALE_FACTOR
-
-
Constructor Details
-
UITools
public UITools()
-
-
Method Details
-
addEscapeActionToDialog
-
addEscapeActionToDialog
-
addKeyActionToDialog
-
convertPointFromAncestor
-
convertPointToAncestor
-
convertRectangleToAncestor
-
convertPointToAncestor
-
errorMessage
-
getCurrentRootComponent
-
getCurrentFrame
-
getFrame
-
getMenuComponent
-
getKeyStroke
returns a KeyStroke if possible and null otherwise. -
keyStrokeToString
formats a KeyStroke in a ledgible way, e.g. Control+V. Null is converted to "". Taken from MotifGraphicsUtils.paintMenuItem(). -
informationMessage
-
informationMessage
-
informationMessage
-
informationMessage
-
setBounds
-
getValidFrameBounds
-
getAvailableScreenBounds
-
getScreenBounds
-
setDialogLocationRelativeTo
-
findBestLocation
-
setDialogLocationRelativeTo
public static void setDialogLocationRelativeTo(JDialog dialog, org.freeplane.features.map.NodeModel node) -
setDialogLocationUnder
public static void setDialogLocationUnder(JDialog dialog, org.freeplane.features.map.NodeModel node) -
showAttributeEmptyStringErrorMessage
public static void showAttributeEmptyStringErrorMessage()Shows the error message "attributes_adding_empty_attribute_error" -
showMessage
-
showConfirmDialog
-
showConfirmDialog
-
showInputDialog
-
showInputDialog
-
setScrollbarIncrement
-
addScrollbarIncrementPropertyListener
-
getTextColorForBackground
-
isLight
-
isLighter
-
focusOn
-
createStroke
-
repaintAll
-
createCancelDialog
-
createCancelDialog
-
addTitledBorder
-
backOtherWindows
public static void backOtherWindows() -
createHtmlLinkStyleButton
-
getComponentIndex
-
scale
-
scaleUI
-
scaleFontInt
-
invertScale
-
showFrame
public static void showFrame() -
isEditingText
public static boolean isEditingText() -
executeWhenNodeHasFocus
-
getUIFontSize
public static int getUIFontSize(double scalingFactor) -
getUIFontSize
public static int getUIFontSize(float scalingFactor) -
getUIFont
-
getUIFont
-
getDefaultLabelFont
-
newFileChooser
-
newFileChooser
-
getFreeplaneTabbedPanel
-
isLightLookAndFeelInstalled
public static boolean isLightLookAndFeelInstalled()
-