UITools

org.freeplane.core.ui.components

## クラス UITools

- java.lang.Object
- - org.freeplane.core.ui.components.UITools

-     public class UITools
      extends java.lang.Object

  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

  導入されたバージョン:
    29.12.2008
  作成者:
    Dimitry Polivaev

- - ### ネストされたクラスの概要

    ネストされたクラス
    修飾子とタイプ | クラスと説明
    --- | ---
    `static class` | `UITools.InsertEolAction`

  - ### フィールドの概要

    フィールド
    修飾子とタイプ | フィールドと説明
    --- | ---
    `static float` | `FONT_SCALE_FACTOR`
    `static java.lang.String` | `MAIN_FREEPLANE_FRAME`
    `static java.awt.Dimension` | `MAX_BUTTON_DIMENSION`
    `static java.lang.String` | `SCROLLBAR_INCREMENT`

  - ### コンストラクタの概要

    コンストラクタ
    コンストラクタと説明
    `UITools()`

  - ### メソッドの概要

    メソッド
    修飾子とタイプ | メソッドと説明
    --- | ---
    `static void` | `addEscapeActionToDialog(javax.swing.JDialog dialog)`
    `static void` | `addEscapeActionToDialog(javax.swing.JDialog dialog, javax.swing.Action action)`
    `static void` | `addKeyActionToDialog(javax.swing.JDialog dialog, javax.swing.Action action, java.lang.String keyStroke, java.lang.String actionId)`
    `static void` | `addScrollbarIncrementPropertyListener(javax.swing.JScrollPane scrollPane)`
    `static void` | `addTitledBorder(javax.swing.JComponent c, java.lang.String title, float size)`
    `static void` | `backOtherWindows()`
    `static void` | `convertPointFromAncestor(java.awt.Component ancestor, java.awt.Point p, java.awt.Component c)`
    `static void` | `convertPointToAncestor(java.awt.Component source, java.awt.Point point, java.lang.Class<?> ancestorClass)`
    `static void` | `convertPointToAncestor(java.awt.Component from, java.awt.Point p, java.awt.Component destination)`
    `static void` | `convertRectangleToAncestor(java.awt.Component from, java.awt.Rectangle r, java.awt.Component destination)`
    `static javax.swing.JDialog` | `createCancelDialog(java.awt.Component component, java.lang.String titel, java.lang.String text)`
    `static javax.swing.JButton` | `createHtmlLinkStyleButton(java.net.URI uri, java.lang.String title)`
    `static java.awt.BasicStroke` | `createStroke(int width, int[] dash)`
    `static void` | `errorMessage(java.lang.Object message)`
    `static void` | `focusOn(javax.swing.JComponent component)`
    `static int` | `getComponentIndex(java.awt.Component component)`
    `static java.awt.Rectangle` | `getDesktopBounds(java.awt.Component frame)`
    `static java.awt.Frame` | `getFrame()`
    `static javax.swing.KeyStroke` | `getKeyStroke(java.lang.String keyStrokeDescription)` returns a KeyStroke if possible and null otherwise.
    `static int` | `getScreenResolution()`
    `static java.awt.Color` | `getTextColorForBackground(java.awt.Color color)`
    `static void` | `informationMessage(java.awt.Frame frame, java.lang.String message)`
    `static void` | `informationMessage(java.awt.Frame frame, java.lang.String message, java.lang.String title)`
    `static void` | `informationMessage(java.awt.Frame frame, java.lang.String text, java.lang.String string, int type)`
    `static void` | `informationMessage(java.lang.String message)`
    `static java.awt.Font` | `invertScale(java.awt.Font font)`
    `static boolean` | `isEditingText()`
    `static java.lang.String` | `keyStrokeToString(javax.swing.KeyStroke keyStroke)` formats a KeyStroke in a ledgible way, e.g.
    `static void` | `repaintAll(java.awt.Container root)`
    `static java.awt.Font` | `scale(java.awt.Font font)`
    `static void` | `setBounds(java.awt.Component frame, int win_x, int win_y, int win_width, int win_height)`
    `static void` | `setDialogLocationRelativeTo(javax.swing.JDialog dialog, java.awt.Component c)`
    `static void` | `setDialogLocationRelativeTo(javax.swing.JDialog dialog, org.freeplane.features.map.NodeModel node)`
    `static void` | `setDialogLocationUnder(javax.swing.JDialog dialog, org.freeplane.features.map.NodeModel node)`
    `static void` | `setScrollbarIncrement(javax.swing.JScrollPane scrollPane)`
    `static void` | `showAttributeEmptyStringErrorMessage()` Shows the error message "attributes_adding_empty_attribute_error"
    `static int` | `showConfirmDialog(org.freeplane.features.map.NodeModel node, java.lang.Object message, java.lang.String title, int optionType)`
    `static int` | `showConfirmDialog(org.freeplane.features.map.NodeModel node, java.lang.Object message, java.lang.String title, int optionType, int messageType)`
    `static void` | `showFrame()`
    `static java.lang.String` | `showInputDialog(org.freeplane.features.map.NodeModel node, java.lang.String message, java.lang.String initialValue)`
    `static java.lang.String` | `showInputDialog(org.freeplane.features.map.NodeModel node, java.lang.String text, java.lang.String title, int type)`
    `static void` | `showMessage(java.lang.String message, int messageType)`

    - ### クラスから継承されたメソッド java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### フィールドの詳細

    - #### MAIN_FREEPLANE_FRAME

          public static final java.lang.String MAIN_FREEPLANE_FRAME

      関連項目:
        定数フィールド値

    - #### SCROLLBAR_INCREMENT

          public static final java.lang.String SCROLLBAR_INCREMENT

      関連項目:
        定数フィールド値

    - #### MAX_BUTTON_DIMENSION

          public static final java.awt.Dimension MAX_BUTTON_DIMENSION

    - #### FONT_SCALE_FACTOR

          public static final float FONT_SCALE_FACTOR

  - ### コンストラクタの詳細

    - #### UITools

          public UITools()

  - ### メソッドの詳細

    - #### addEscapeActionToDialog

          public static void addEscapeActionToDialog(javax.swing.JDialog dialog)

    - #### addEscapeActionToDialog

          public static void addEscapeActionToDialog(javax.swing.JDialog dialog,
                                     javax.swing.Action action)

    - #### addKeyActionToDialog

          public static void addKeyActionToDialog(javax.swing.JDialog dialog,
                                  javax.swing.Action action,
                                  java.lang.String keyStroke,
                                  java.lang.String actionId)

    - #### convertPointFromAncestor

          public static void convertPointFromAncestor(java.awt.Component ancestor,
                                      java.awt.Point p,
                                      java.awt.Component c)

    - #### convertPointToAncestor

          public static void convertPointToAncestor(java.awt.Component source,
                                    java.awt.Point point,
                                    java.lang.Class<?> ancestorClass)

    - #### convertRectangleToAncestor

          public static void convertRectangleToAncestor(java.awt.Component from,
                                        java.awt.Rectangle r,
                                        java.awt.Component destination)

    - #### convertPointToAncestor

          public static void convertPointToAncestor(java.awt.Component from,
                                    java.awt.Point p,
                                    java.awt.Component destination)

    - #### errorMessage

          public static void errorMessage(java.lang.Object message)

    - #### getFrame

          public static java.awt.Frame getFrame()

    - #### getKeyStroke

          public static javax.swing.KeyStroke getKeyStroke(java.lang.String keyStrokeDescription)

      returns a KeyStroke if possible and null otherwise.

    - #### keyStrokeToString

          public static java.lang.String keyStrokeToString(javax.swing.KeyStroke keyStroke)

      formats a KeyStroke in a ledgible way, e.g. Control+V. Null is converted to "". Taken from MotifGraphicsUtils.paintMenuItem().

    - #### informationMessage

          public static void informationMessage(java.lang.String message)

    - #### informationMessage

          public static void informationMessage(java.awt.Frame frame,
                                java.lang.String message)

    - #### informationMessage

          public static void informationMessage(java.awt.Frame frame,
                                java.lang.String message,
                                java.lang.String title)

    - #### informationMessage

          public static void informationMessage(java.awt.Frame frame,
                                java.lang.String text,
                                java.lang.String string,
                                int type)

    - #### setBounds

          public static void setBounds(java.awt.Component frame,
                       int win_x,
                       int win_y,
                       int win_width,
                       int win_height)

    - #### getDesktopBounds

          public static java.awt.Rectangle getDesktopBounds(java.awt.Component frame)

    - #### setDialogLocationRelativeTo

          public static void setDialogLocationRelativeTo(javax.swing.JDialog dialog,
                                         java.awt.Component c)

    - #### setDialogLocationRelativeTo

          public static void setDialogLocationRelativeTo(javax.swing.JDialog dialog,
                                         org.freeplane.features.map.NodeModel node)

    - #### setDialogLocationUnder

          public static void setDialogLocationUnder(javax.swing.JDialog dialog,
                                    org.freeplane.features.map.NodeModel node)

    - #### showAttributeEmptyStringErrorMessage

          public static void showAttributeEmptyStringErrorMessage()

      Shows the error message "attributes_adding_empty_attribute_error"

    - #### showMessage

          public static void showMessage(java.lang.String message,
                         int messageType)

    - #### showConfirmDialog

          public static int showConfirmDialog(org.freeplane.features.map.NodeModel node,
                              java.lang.Object message,
                              java.lang.String title,
                              int optionType,
                              int messageType)

    - #### showConfirmDialog

          public static int showConfirmDialog(org.freeplane.features.map.NodeModel node,
                              java.lang.Object message,
                              java.lang.String title,
                              int optionType)

    - #### showInputDialog

          public static java.lang.String showInputDialog(org.freeplane.features.map.NodeModel node,
                                         java.lang.String message,
                                         java.lang.String initialValue)

    - #### showInputDialog

          public static java.lang.String showInputDialog(org.freeplane.features.map.NodeModel node,
                                         java.lang.String text,
                                         java.lang.String title,
                                         int type)

    - #### setScrollbarIncrement

          public static void setScrollbarIncrement(javax.swing.JScrollPane scrollPane)

    - #### addScrollbarIncrementPropertyListener

          public static void addScrollbarIncrementPropertyListener(javax.swing.JScrollPane scrollPane)

    - #### getTextColorForBackground

          public static java.awt.Color getTextColorForBackground(java.awt.Color color)

    - #### focusOn

          public static void focusOn(javax.swing.JComponent component)

    - #### createStroke

          public static java.awt.BasicStroke createStroke(int width,
                                          int[] dash)

    - #### repaintAll

          public static void repaintAll(java.awt.Container root)

    - #### createCancelDialog

          public static javax.swing.JDialog createCancelDialog(java.awt.Component component,
                                               java.lang.String titel,
                                               java.lang.String text)

    - #### addTitledBorder

          public static void addTitledBorder(javax.swing.JComponent c,
                             java.lang.String title,
                             float size)

    - #### backOtherWindows

          public static void backOtherWindows()

    - #### createHtmlLinkStyleButton

          public static javax.swing.JButton createHtmlLinkStyleButton(java.net.URI uri,
                                                      java.lang.String title)

    - #### getComponentIndex

          public static final int getComponentIndex(java.awt.Component component)

    - #### getScreenResolution

          public static int getScreenResolution()

    - #### scale

          public static java.awt.Font scale(java.awt.Font font)

    - #### invertScale

          public static java.awt.Font invertScale(java.awt.Font font)

    - #### showFrame

          public static void showFrame()

    - #### isEditingText

          public static boolean isEditingText()