예제 #1
0
 /** Create a new MLED from the given delegate */
 public MLED(ControlDelegate delegate) {
   super();
   this.delegate = delegate;
   delegate.setOwner(this);
   setBounds(delegate.getCtrlDef().targetBounds.getRectangle());
   setOpaque(true);
 }
예제 #2
0
 /**
  * return a string representation of this MControl by including the control's type and name as
  * specified in the skin definition file.
  */
 @Override
 public String toString() {
   if (delegate != null && delegate.getCtrlDef() != null) {
     return delegate.getCtrlDef().fullName + ": " + super.toString();
   }
   return super.toString();
 }
예제 #3
0
 /** return if this LED is lit */
 public boolean isSelected() {
   return delegate.isDown();
 }
예제 #4
0
 /** light up this LED */
 public void setSelected(boolean on) {
   if (delegate.isDown() != on) {
     delegate.setDown(on);
     repaint();
   }
 }
예제 #5
0
 @Override
 public Dimension getMaximumSize() {
   return delegate.getMaximumSize();
 }
예제 #6
0
 @Override
 public Dimension getPreferredSize() {
   return delegate.getPreferredSize();
 }
예제 #7
0
 @Override
 public void paint(Graphics g) {
   delegate.paint(g);
 }