jrubyfx 1.0.0-java → 1.1.0-java

Sign up to get free protection for your applications and to get access to all the features.
@@ -73,6 +73,7 @@ module JRubyFX
73
73
  :value => ['ChangeListener']
74
74
  },
75
75
  :collections => ['FXCollections'],
76
+ :concurrent => %w[Worker Task Service],
76
77
  :event => %w[Event ActionEvent EventHandler],
77
78
  :fxml => ['Initializable', 'LoadException'],
78
79
  :geometry => %w[HorizontalDirection HPos Insets Orientation Pos Rectangle2D Side VerticalDirection VPos],
@@ -105,13 +106,24 @@ module JRubyFX
105
106
  }
106
107
  }
107
108
 
109
+ $WRITE_OUT << <<HERE
110
+ def const_missing(c)
111
+ if LOCAL_NAME_MAP.has_key? c
112
+ java_import(LOCAL_NAME_MAP[c])[0]
113
+ else
114
+ super
115
+ end
116
+ end
117
+
118
+ HERE
119
+
108
120
  # Imports all the listed JavaFX classes
109
- $WRITE_OUT << "java_import "
121
+ $WRITE_OUT << "LOCAL_NAME_MAP = { \n "
110
122
  $WRITE_OUT << (JFX_CLASS_HIERARCHY.flat_tree_inject do |res, name, values|
111
123
  name = "#{name.to_s}."
112
124
  name = "" if name == "."
113
125
  res.concat(values.map{|i| "#{name}#{i}"})
114
- end).map{|x| "'#{x}'"}.join(",")
115
- $WRITE_OUT << "\njava_import 'java.lang.Void'"
126
+ end).map{|x| "#{x.split(".").last.to_sym.inspect} => #{x.inspect}"}.join(",\n ")
127
+ $WRITE_OUT << "\n}\njava_import 'java.lang.Void'"
116
128
  end
117
129
  end
@@ -169,11 +169,11 @@ module JRubyFX
169
169
  ENUM_CACHE = {}
170
170
 
171
171
  # Store enum mapping overrides
172
- ENUM_OVERRIDES = {Java::javafxAnimation::PathTransition::OrientationType => {:orthogonal_to_tangent => :orthogonal},
173
- Java::javafxSceneEffect::BlendMode => {:src_over => :over, :src_atop => :atop, :color_dodge => :dodge, :color_burn => :burn},
174
- Java::javafxSceneControl::ContentDisplay => {:graphic_only => :graphic, :text_only => :text},
175
- Java::javafxSceneEffect::BlurType => {:one_pass_box => [:one, :one_pass], :two_pass_box => [:two, :two_pass], :three_pass_box => [:three, :three_pass]},
176
- Java::javafxStage::Modality => {:window_modal => :window, :application_modal => [:application, :app]}}
172
+ ENUM_OVERRIDES = {Java::JavafxAnimation::PathTransition::OrientationType => {:orthogonal_to_tangent => :orthogonal},
173
+ Java::JavafxSceneEffect::BlendMode => {:src_over => :over, :src_atop => :atop, :color_dodge => :dodge, :color_burn => :burn},
174
+ Java::JavafxSceneControl::ContentDisplay => {:graphic_only => :graphic, :text_only => :text},
175
+ Java::JavafxSceneEffect::BlurType => {:one_pass_box => [:one, :one_pass], :two_pass_box => [:two, :two_pass], :three_pass_box => [:three, :three_pass]},
176
+ Java::JavafxStage::Modality => {:window_modal => :window, :application_modal => [:application, :app]}}
177
177
 
178
178
  # sets the given overrides for the given class/enum
179
179
  def self.set_overrides_for(enum_class,ovr)
@@ -1,4 +1,4 @@
1
1
  module JRubyFX
2
2
  # Current gem version. Used in rake task.
3
- VERSION='1.0.0'
3
+ VERSION='1.1.0'
4
4
  end
@@ -34,7 +34,7 @@ module JRubyFX
34
34
  # corrupt or an older version, set force to true to delete and re-download
35
35
  def download_jruby(jruby_version, force=false)
36
36
  dist = "#{ENV['HOME']}/.jruby-jar"
37
- unless force || (File.exists?("#{dist}/jruby-complete.jar") && File.size("#{dist}/jruby-complete.jar") > 0)
37
+ unless force || (File.exists?("#{dist}/jruby-complete-#{jruby_version}.jar") && File.size("#{dist}/jruby-complete-#{jruby_version}.jar") > 0)
38
38
  mkdir_p dist
39
39
  base_dir = Dir.pwd
40
40
  cd dist
@@ -63,11 +63,11 @@ module JRubyFX
63
63
  mkdir_p target
64
64
 
65
65
  #copy jruby jar file in, along with script and our rb files
66
- cp "#{ENV['HOME']}/.jruby-jar/jruby-complete.jar", "#{target}/#{output_jar}"
66
+ cp "#{ENV['HOME']}/.jruby-jar/jruby-complete-#{opts[:version] || JRUBY_VERSION}.jar", "#{target}/#{output_jar}"
67
67
 
68
68
  #copy source in
69
69
  FileList[src].each do |iv_srv|
70
- cp iv_srv, "#{target}/#{File.basename(iv_srv)}" if (main_script == nil || main_script != iv_srv) && opts[:file_filter].call(iv_srv)
70
+ cp_r iv_srv, "#{target}/#{File.basename(iv_srv)}" if (main_script == nil || main_script != iv_srv) && opts[:file_filter].call(iv_srv)
71
71
  end
72
72
  cp main_script, "#{target}/jar-bootstrap.rb" unless main_script == nil
73
73
 
@@ -83,10 +83,22 @@ module JRubyFX
83
83
  FileList["#{File.dirname(__FILE__)}/*"].each do |librb|
84
84
  cp_r librb, target
85
85
  end
86
-
86
+
87
+ fxml_loader_path = nil
88
+ # this will find it if we are calling ruby -I whatever
89
+ $LOAD_PATH.each do |pth|
90
+ if File.exist? File.join(pth, "jrubyfx-fxmlloader.rb")
91
+ fxml_loader_path = pth
92
+ break
93
+ end
94
+ end
95
+
96
+ # default to gems
97
+ unless fxml_loader_path
98
+ fxml_loader_path = File.join(Gem::Specification.find_by_path('jrubyfx-fxmlloader').full_gem_path, "lib")
99
+ end
87
100
  #copy fxmlloader in
88
- require 'jrubyfx-fxmlloader'
89
- FileList["#{File.dirname(MAGIC_FXML_JAVAFX_JRUBYFX_FXMLLOADER__FILE__LOCATION_SUPER_SECRET)}/*"].each do |librb|
101
+ FileList["#{fxml_loader_path}/*"].each do |librb|
90
102
  cp_r librb, target
91
103
  end
92
104
 
@@ -116,7 +128,7 @@ module JRubyFX
116
128
 
117
129
  # the native bundling uses ant
118
130
  require "ant"
119
-
131
+
120
132
  output_jar = Pathname.new(output_jar)
121
133
  dist_dir = output_jar.parent
122
134
  jar_name = File.basename(output_jar)
@@ -146,10 +158,16 @@ module JRubyFX
146
158
  rm FileList["#{full_build_dir}*.html","#{full_build_dir}*.jnlp"]
147
159
  end
148
160
 
161
+ def compile(cmdline)
162
+ require 'jrubyfx/compiler_app'
163
+ $JRUBYFX_AOT_COMPILING = true
164
+ CompilerApp.launch(*cmdline) # must use this to provide a full javafx environ so controls will build properly
165
+ end
166
+
149
167
 
150
168
  private
151
169
  def download(version_string) #:nodoc:
152
- File.open("jruby-complete.jar","wb") do |f|
170
+ File.open("jruby-complete-#{version_string}.jar","wb") do |f|
153
171
  f.write(open("#{BASE_URL}/#{version_string}/jruby-complete-#{version_string}.jar").read)
154
172
  end
155
173
  end
@@ -158,5 +176,6 @@ module JRubyFX
158
176
  module_function :download_jruby
159
177
  module_function :native_bundles
160
178
  module_function :download
179
+ module_function :compile
161
180
  end
162
181
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: jrubyfx
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 1.0.0
5
+ version: 1.1.0
6
6
  platform: java
7
7
  authors:
8
8
  - Patrick Plenefisch
@@ -12,7 +12,7 @@ authors:
12
12
  autorequire:
13
13
  bindir: bin
14
14
  cert_chain: []
15
- date: 2013-05-20 00:00:00.000000000 Z
15
+ date: 2013-09-28 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: rake
@@ -52,13 +52,13 @@ dependencies:
52
52
  requirements:
53
53
  - - '>='
54
54
  - !ruby/object:Gem::Version
55
- version: '0.2'
55
+ version: '0.3'
56
56
  none: false
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - '>='
60
60
  - !ruby/object:Gem::Version
61
- version: '0.2'
61
+ version: '0.3'
62
62
  none: false
63
63
  prerelease: false
64
64
  type: :runtime
@@ -71,51 +71,56 @@ email:
71
71
  executables:
72
72
  - jrubyfx-generator
73
73
  - jrubyfx-jarify
74
+ - jrubyfx-compile
74
75
  extensions: []
75
76
  extra_rdoc_files: []
76
77
  files:
77
78
  - lib/jrubyfx.rb
78
79
  - lib/jrubyfx_tasks.rb
79
- - lib/jrubyfx/controller.rb
80
- - lib/jrubyfx/application.rb
81
- - lib/jrubyfx/utils.rb
82
- - lib/jrubyfx/dsl.rb
83
80
  - lib/jrubyfx/part_imports.rb
81
+ - lib/jrubyfx/dsl.rb
82
+ - lib/jrubyfx/version.rb
83
+ - lib/jrubyfx/controller.rb
84
+ - lib/jrubyfx/compiler_app.rb
84
85
  - lib/jrubyfx/dsl_map.rb
85
86
  - lib/jrubyfx/imports.rb
86
87
  - lib/jrubyfx/module.rb
88
+ - lib/jrubyfx/application.rb
87
89
  - lib/jrubyfx/java_fx_impl.rb
88
- - lib/jrubyfx/version.rb
89
- - lib/jrubyfx/utils/common_utils.rb
90
- - lib/jrubyfx/utils/common_converters.rb
91
- - lib/jrubyfx/utils/__ignore_java_stupid_rdoc.rb
92
- - lib/jrubyfx/core_ext/observable_value.rb
93
- - lib/jrubyfx/core_ext/drag_event.rb
94
- - lib/jrubyfx/core_ext/exts.yml
95
- - lib/jrubyfx/core_ext/progress_indicator.rb
96
- - lib/jrubyfx/core_ext/effects.rb
97
- - lib/jrubyfx/core_ext/stage.rb
90
+ - lib/jrubyfx/utils.rb
91
+ - lib/jrubyfx/core_ext/grid_pane.rb
98
92
  - lib/jrubyfx/core_ext/media_player.rb
99
- - lib/jrubyfx/core_ext/pagination.rb
100
- - lib/jrubyfx/core_ext/xy_chart.rb
93
+ - lib/jrubyfx/core_ext/duration.rb
94
+ - lib/jrubyfx/core_ext/effects.rb
101
95
  - lib/jrubyfx/core_ext/transition.rb
102
- - lib/jrubyfx/core_ext/border_pane.rb
96
+ - lib/jrubyfx/core_ext/pagination.rb
97
+ - lib/jrubyfx/core_ext/drag_event.rb
98
+ - lib/jrubyfx/core_ext/region.rb
103
99
  - lib/jrubyfx/core_ext/image_view.rb
104
100
  - lib/jrubyfx/core_ext/tree_view.rb
105
101
  - lib/jrubyfx/core_ext/table_view.rb
106
- - lib/jrubyfx/core_ext/region.rb
107
- - lib/jrubyfx/core_ext/timeline.rb
108
- - lib/jrubyfx/core_ext/duration.rb
102
+ - lib/jrubyfx/core_ext/file_chooser.rb
103
+ - lib/jrubyfx/core_ext/geometry.rb
104
+ - lib/jrubyfx/core_ext/xy_chart.rb
109
105
  - lib/jrubyfx/core_ext/rotate.rb
106
+ - lib/jrubyfx/core_ext/exts.yml
110
107
  - lib/jrubyfx/core_ext/column_constraints.rb
108
+ - lib/jrubyfx/core_ext/observable_value.rb
111
109
  - lib/jrubyfx/core_ext/precompiled.rb
110
+ - lib/jrubyfx/core_ext/stage.rb
111
+ - lib/jrubyfx/core_ext/border_pane.rb
112
+ - lib/jrubyfx/core_ext/timeline.rb
112
113
  - lib/jrubyfx/core_ext/radial_gradient.rb
114
+ - lib/jrubyfx/core_ext/progress_indicator.rb
113
115
  - lib/jrubyfx/core_ext/path.rb
114
- - lib/jrubyfx/core_ext/file_chooser.rb
116
+ - lib/jrubyfx/utils/common_utils.rb
117
+ - lib/jrubyfx/utils/common_converters.rb
118
+ - lib/jrubyfx/utils/__ignore_java_stupid_rdoc.rb
115
119
  - LICENSE
116
120
  - README.md
117
121
  - bin/jrubyfx-generator
118
122
  - bin/jrubyfx-jarify
123
+ - bin/jrubyfx-compile
119
124
  homepage: https://github.com/jruby/jrubyfx
120
125
  licenses: []
121
126
  post_install_message:
@@ -127,12 +132,18 @@ required_ruby_version: !ruby/object:Gem::Requirement
127
132
  - - '>='
128
133
  - !ruby/object:Gem::Version
129
134
  version: '0'
135
+ segments:
136
+ - 0
137
+ hash: 2
130
138
  none: false
131
139
  required_rubygems_version: !ruby/object:Gem::Requirement
132
140
  requirements:
133
141
  - - '>='
134
142
  - !ruby/object:Gem::Version
135
143
  version: '0'
144
+ segments:
145
+ - 0
146
+ hash: 2
136
147
  none: false
137
148
  requirements: []
138
149
  rubyforge_project: jrubyfx