Class: RSwing::Components::Frame

Inherits:
JFrame
  • Object
show all
Includes:
Window
Defined in:
lib/rswing/components/frame.rb

Constant Summary

Constants included from Events::WindowFocus

Events::WindowFocus::WindowFocusListener

Constants included from Events::WindowState

Events::WindowState::WindowStateListener

Constants included from Events::PropertyChanged

Events::PropertyChanged::PropertyChangeListener

Constants included from Events::ContainerEvents

Events::ContainerEvents::ContainerListener

Constants included from Events::FocusEvents

Events::FocusEvents::FocusListener

Constants included from Events::InputMethodEvents

Events::InputMethodEvents::InputMethodListener

Constants included from Events::HierarchyBoundsEvents

Events::HierarchyBoundsEvents::HierarchyBoundsListener

Constants included from Events::KeyEvents

Events::KeyEvents::KeyListener

Constants included from Events::MouseWheelEvents

Events::MouseWheelEvents::MouseWheelListener

Constants included from Events::MouseMotionEvents

Events::MouseMotionEvents::MouseMotionListener

Constants included from Events::MouseEvents

Events::MouseEvents::MouseListener

Constants included from Events::ComponentEvents

Events::ComponentEvents::ComponentListener

Instance Method Summary collapse

Methods included from Window

init, #location=, #size=

Methods included from Events::WindowFocus

event_mappings

Methods included from Container

#[], #add, add_if_requested, #add_with_name, #components, #remove

Methods included from Events::ContainerEvents

event_mappings

Methods included from Events::FocusEvents

event_mappings

Methods included from Events::InputMethodEvents

event_mappings

Methods included from Events::HierarchyBoundsEvents

event_mappings

Methods included from Events::KeyEvents

event_mappings

Methods included from Events::MouseMotionEvents

event_mappings

Methods included from Events::MouseEvents

event_mappings

Methods included from Events::ComponentEvents

event_mappings

Constructor Details

#initialize(title, options = {}, &block) ⇒ Frame

valid options are:

  1. :size => [800, 600] 800x600 pixels (default: nil)



29
30
31
32
33
34
35
36
37
38
# File 'lib/rswing/components/frame.rb', line 29

def initialize(title, options = {}, &block)
  super(title)
  
  Window.init(self, options)
  
  # falls block übergeben wurde, mit aktuellem objekt aufrufen
  if block_given?
    yield self
  end
end

Instance Method Details

#default_close_operation=(op = :hide_on_close) ⇒ Object

Sets the default close operation for this frame. Valid operations are:

  1. :do_nothing_on_close

  2. :hide_on_close (default)

  3. :dispose_on_close

  4. :exit_on_close



46
47
48
49
50
51
52
53
54
55
56
57
# File 'lib/rswing/components/frame.rb', line 46

def default_close_operation=(op = :hide_on_close)
  case op
  when :do_nothing_on_close
    self.setDefaultCloseOperation(WindowConstants::DO_NOTHING_ON_CLOSE)
  when :hide_on_close
    self.setDefaultCloseOperation(WindowConstants::HIDE_ON_CLOSE)
  when :dispose_on_close
    self.setDefaultCloseOperation(WindowConstants::DISPOSE_ON_CLOSE)
  when :exit_on_close
    self.setDefaultCloseOperation(JFrame::EXIT_ON_CLOSE)
  end
end