FreeplaneScriptBaseClass

org.freeplane.plugin.script

## クラス FreeplaneScriptBaseClass

- java.lang.Object
- - groovy.lang.GroovyObjectSupport
  - - groovy.lang.Script
    - - org.freeplane.plugin.script.FreeplaneScriptBaseClass

- すべての実装されたインタフェース:
    groovy.lang.GroovyObject

      public abstract class FreeplaneScriptBaseClass
      extends groovy.lang.Script

  All methods of this class are available as "global" methods in every script. Only documented methods are meant to be used in scripts.

  The following global objects are provided as shortcuts by the binding of this class:

  - ui: see `UITools`
  - logger: see `LogUtils`
  - htmlUtils: see `HtmlUtils`
  - textUtils: see `TextUtils`
  - menuUtils: see `MenuUtils`
  - config: see `FreeplaneScriptBaseClass.ConfigProperties`
  The following classes may also be useful in scripting:
  - `FreeplaneVersion`

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

    ネストされたクラス
    修飾子とタイプ | クラスと説明
    --- | ---
    `static class` | `FreeplaneScriptBaseClass.ConfigProperties` Accessor for Freeplane's configuration: In scripts available as "global variable" `config`.

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

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

  - ### メソッドの概要

    メソッド
    修飾子とタイプ | メソッドと説明
    --- | ---
    `java.lang.Object` | `format(java.lang.Object object)` Applies default date-time format for dates or default number format for numbers.
    `java.lang.Object` | `format(java.lang.Object object, java.lang.String formatString)` uses formatString to return a FormattedObject.
    `java.lang.Object` | `formatDate(java.util.Date date)` Applies default date format (instead of standard date-time) format on the given date.
    `java.lang.Object` | `getProperty(java.lang.String property)`
    `java.lang.Object` | `ifNull(java.lang.Object value, java.lang.Object valueIfNull)` returns valueIfNull if value is null and value otherwise.
    `void` | `initBinding()`
    `java.lang.Object` | `invokeMethod(java.lang.String methodName, java.lang.Object args)`
    `void` | `loadUri(java.net.URI uri)` opens a `URI`
    `Proxy.NodeRO` | `N(java.lang.String id)` Shortcut for node.map.node(id) - necessary for ids to other maps.
    `java.lang.Object` | `parse(java.lang.String text)` parses text to the proper data type, if possible, setting format to the standard.
    `java.lang.Long` | `round(java.lang.Double d)` rounds a number to integral type.
    `java.lang.Double` | `round(java.lang.Double d, int precision)` round to the given number of decimal places: `round(0.1234, 2) -> 0.12`
    `void` | `setBinding(groovy.lang.Binding binding)`
    `java.lang.String` | `T(java.lang.String id)` Shortcut for node.map.node(id).text.
    `java.lang.String` | `toString(java.lang.Object o)` formats according to the internal standard, that is the conversion will be reversible for types that are handled special by the scripting api namely Dates and Numbers.
    `java.lang.Object` | `V(java.lang.String id)` Shortcut for node.map.node(id).value.

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

      `evaluate, evaluate, getBinding, print, printf, printf, println, println, run, run, setProperty`

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

      `getMetaClass, setMetaClass`

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

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

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

    - #### FreeplaneScriptBaseClass

          public FreeplaneScriptBaseClass()

  - ### メソッドの詳細

    - #### initBinding

          public void initBinding()

    - #### setBinding

          public void setBinding(groovy.lang.Binding binding)

      オーバーライド:
        `setBinding` クラス内 `groovy.lang.Script`

    - #### getProperty

          public java.lang.Object getProperty(java.lang.String property)

      定義:
        `getProperty` インタフェース内 `groovy.lang.GroovyObject`
      オーバーライド:
        `getProperty` クラス内 `groovy.lang.Script`

    - #### invokeMethod

          public java.lang.Object invokeMethod(java.lang.String methodName,
                                      java.lang.Object args)

      定義:
        `invokeMethod` インタフェース内 `groovy.lang.GroovyObject`
      オーバーライド:
        `invokeMethod` クラス内 `groovy.lang.Script`

    - #### N

          public Proxy.NodeRO N(java.lang.String id)

      Shortcut for node.map.node(id) - necessary for ids to other maps.

    - #### T

          public java.lang.String T(java.lang.String id)

      Shortcut for node.map.node(id).text.

    - #### V

          public java.lang.Object V(java.lang.String id)

      Shortcut for node.map.node(id).value.

    - #### ifNull

          public java.lang.Object ifNull(java.lang.Object value,
                                java.lang.Object valueIfNull)

      returns valueIfNull if value is null and value otherwise.

    - #### round

          public java.lang.Long round(java.lang.Double d)

      rounds a number to integral type.

    - #### round

          public java.lang.Double round(java.lang.Double d,
                               int precision)

      round to the given number of decimal places: `round(0.1234, 2) -> 0.12`

    - #### parse

          public java.lang.Object parse(java.lang.String text)

      parses text to the proper data type, if possible, setting format to the standard. Parsing is configured via config file scanner.xml

           assert parse('2012-11-30') instanceof Date
           assert parse('1.22') instanceof Number
           // if parsing fails the original string is returned
           assert parse('2012XX11-30') == '2012XX11-30'

           def d = parse('2012-10-30')
           c.statusInfo = "${d} is ${new Date() - d} days ago"

    - #### format

          public java.lang.Object format(java.lang.Object object,
                                java.lang.String formatString)

      uses formatString to return a FormattedObject.

      Note: If you want to format the node core better use the format node attribute instead:

           node.object = new Date()
           node.format = 'dd/MM/yy'

      戻り値:
        `IFormattedObject` if object is formattable and the unchanged object otherwise.

    - #### format

          public java.lang.Object format(java.lang.Object object)

      Applies default date-time format for dates or default number format for numbers. All other objects are left unchanged.
      戻り値:
        `IFormattedObject` if object is formattable and the unchanged object otherwise.

    - #### formatDate

          public java.lang.Object formatDate(java.util.Date date)

      Applies default date format (instead of standard date-time) format on the given date.
      戻り値:
        `IFormattedObject` if object is formattable and the unchanged object otherwise.

    - #### toString

          public java.lang.String toString(java.lang.Object o)

      formats according to the internal standard, that is the conversion will be reversible for types that are handled special by the scripting api namely Dates and Numbers.
      関連項目:
        `Convertible.toString(Object)`

    - #### loadUri

          public void loadUri(java.net.URI uri)

      opens a `URI`