Class: RSwing::Components::Panel

Inherits:
JPanel
  • Object
show all
Includes:
Container
Defined in:
lib/rswing/components/panel.rb

Constant Summary

Constants included from Events::ContainerEvents

Events::ContainerEvents::ContainerListener

Constants included from Events::FocusEvents

Events::FocusEvents::FocusListener

Constants included from Events::PropertyChanged

Events::PropertyChanged::PropertyChangeListener

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 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(options = {}, &block) ⇒ Panel

Returns a new instance of Panel.



27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# File 'lib/rswing/components/panel.rb', line 27

def initialize(options = {}, &block)
  super(Options.value_for(options => :layout_manager), Options.value_for(options => :double_buffer))
  
  if (border_title = Options.value_for(options => :title))
    border = BorderFactory.createTitledBorder(border_title)
    border.title_font = Font.new("Arial", Font::BOLD, 14)
    self.border = border
  end      
  
  # call block with current object, if given
  if block_given?
    yield self
  end
  
  Container.add_if_requested(self, options)
end