Top Level Namespace

Defined Under Namespace

Classes: Attribute, Class, CopyElement, DefineElement, Element, EventHandlerWrapper, FactoryBuilderBuilder, FxmlBuilderBuilder, FxmlJitInfo, FxmlLoader, IncludeElement, InstanceDeclarationElement, JavaProxy, KeyPathMonitor, LoadException, OBJFXBuilderWrapper, PropertyElement, RRBAdapters, RRExpressionValue, ReferenceElement, RelativeFXMLString, RootElement, RubyObjectWrapperBeanAdapter, RubyWrapperBeanAdapter, SRDelegateClass, ScriptElement, ScriptEventHandler, SecretHashCompararator, StupidFixTODOInsets, UnknownStaticPropertyElement, UnknownTypeElement, ValueElement

Constant Summary collapse

FXL =
Infinity =
1.0/0.0

Instance Method Summary collapse

Instance Method Details

#dp(*args) ⇒ Object



99
100
101
# File 'lib/jrubyfx-fxmlloader.rb', line 99

def dp(*args)
  p *args if $DEBUG_IT_FXML
end

#dprint(*args) ⇒ Object



105
106
107
# File 'lib/jrubyfx-fxmlloader.rb', line 105

def dprint(*args)
  print *args if $DEBUG_IT_FXML
end

#dputs(*args) ⇒ Object



102
103
104
# File 'lib/jrubyfx-fxmlloader.rb', line 102

def dputs(*args)
  puts *args if $DEBUG_IT_FXML
end

#javafxObject



24
25
26
# File 'lib/fxmlloader/fxml_jit_info.rb', line 24

def javafx
  Java::javafx
end

#rctor(elt, k, v) ⇒ Object



170
171
172
173
174
175
176
# File 'lib/jrubyfx-fxmlloader.rb', line 170

def rctor(elt, k, v)
  if $DEBUG_IT_FXML_RB
    elt = rmap_wrap elt
    $RB_CMAPPER[elt] = {} unless $RB_CMAPPER[elt]
    $RB_CMAPPER[elt][k] = v
  end
end

#rfx_id(elt, val = nil) ⇒ Object



153
154
155
156
157
158
159
160
# File 'lib/jrubyfx-fxmlloader.rb', line 153

def rfx_id(elt, val=nil)
  elt = rmap_wrap elt
  if val
    $RB_IDMAPPER[elt] = val
  else
    $RB_IDMAPPER[elt]
  end
end

#rfx_id_set?(elt) ⇒ Boolean

Returns:

  • (Boolean)


161
162
163
164
# File 'lib/jrubyfx-fxmlloader.rb', line 161

def rfx_id_set?(elt)
  elt = rmap_wrap elt
  !$RB_MAPPER[elt] or $RB_MAPPER[elt].include? "instance_variable_get(#{("@" + rfx_id(elt)).to_sym.inspect})"
end

#rget(elt, action = :nuke_from_standard_orbit_captain) ⇒ Object



177
178
179
180
181
182
183
184
# File 'lib/jrubyfx-fxmlloader.rb', line 177

def rget(elt, action=:nuke_from_standard_orbit_captain)
  elt = rmap_wrap elt
  tmp = $RB_MAPPER[elt]
  tmp.strip! if tmp
  $RB_MAPPER[elt] = rfx_id(elt) ? "__local_fxml_controller.instance_variable_get(#{("@" + rfx_id(elt)).to_sym.inspect})" : nil

  tmp
end

#rget_sem(sem) ⇒ Object



190
191
192
# File 'lib/jrubyfx-fxmlloader.rb', line 190

def rget_sem(sem)
  $RB_SCRIPT_ENGINE_MAPPINGS[sem]
end

#rmap_wrap(elt) ⇒ Object



130
131
132
133
134
135
136
# File 'lib/jrubyfx-fxmlloader.rb', line 130

def rmap_wrap(elt)
  if elt.kind_of? Java::ComSunJavafxCollections::ObservableListWrapper
    SecretHashCompararator.new(elt)
  else
    elt
  end
end

#rmorph(old, new) ⇒ Object



165
166
167
168
# File 'lib/jrubyfx-fxmlloader.rb', line 165

def rmorph(old, new)
  elt = rmap_wrap elt
  $RB_MAPPER[new] = "build(FxmlBuilderBuilder, #{($RB_CMAPPER[old]||{}).inspect}, #{old.wrapped_class.ruby_class.inspect}) do\n"
end

#rnest(num) ⇒ Object



110
111
112
113
114
115
116
# File 'lib/jrubyfx-fxmlloader.rb', line 110

def rnest(num)
  if num > 0
    $RB_PREFIX += " "
  else
    $RB_PREFIX = $RB_PREFIX[0...-1]
  end
end

#rno_show(elt) ⇒ Object



123
124
125
# File 'lib/jrubyfx-fxmlloader.rb', line 123

def rno_show(elt)
  $RB_NShowMAPPER[elt]=true
end

#rno_show?(elt) ⇒ Boolean

Returns:

  • (Boolean)


126
127
128
# File 'lib/jrubyfx-fxmlloader.rb', line 126

def rno_show?(elt)
  !!$RB_NShowMAPPER[elt]
end

#rputs(elt, args) ⇒ Object



137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
# File 'lib/jrubyfx-fxmlloader.rb', line 137

def rputs(elt, args)
  if $DEBUG_IT_FXML_RB
    if elt == nil
      elt = $last_elt
    else
      $last_elt = elt = rmap_wrap(elt)
    end
    unless $RB_MAPPER[elt]
      $RB_MAPPER[elt] = ""
    end
    $RB_MAPPER[elt] << $RB_PREFIX
    $RB_MAPPER[elt] << args
    $RB_MAPPER[elt] << "\n"
  end
end

#rputs_script(sem, lang) ⇒ Object



186
187
188
# File 'lib/jrubyfx-fxmlloader.rb', line 186

def rputs_script(sem, lang)
  $RB_SCRIPT_ENGINE_MAPPINGS[sem] = lang
end

#rsem_outObject



194
195
196
197
198
199
200
201
202
203
# File 'lib/jrubyfx-fxmlloader.rb', line 194

def rsem_out
  if $RB_SCRIPT_ENGINE_MAPPINGS != {}
    ["(__local_sem_inst = Java.javax.script.ScriptEngineManager.new).setBindings(javax.script.SimpleBindings.new(__local_namespace))",
      *$RB_SCRIPT_ENGINE_MAPPINGS.map{|sem, lang|
        "(__local_sem_lang_inst_#{lang} = __local_sem_inst.getEngineByName(#{lang.inspect}))" +
          ".setBindings(__local_sem_inst.getBindings(), javax.script.ScriptContext.ENGINE_SCOPE)"
      }
    ].join("\n")
  end
end