예제 #1
0
 public SpeedSliderPanel(GUIWorkspace workspace, boolean labelsBelow) {
   this.workspace = workspace;
   this.labelsBelow = labelsBelow;
   speedSlider = new SpeedSlider((int) workspace.speedSliderPosition());
   speedSlider.setFocusable(false);
   speedSlider.addChangeListener(this);
   speedSlider.addMouseListener(this);
   speedSlider.setOpaque(false);
   org.nlogo.awt.Fonts.adjustDefaultFont(normal);
   setOpaque(false);
   if (labelsBelow) {
     GridBagLayout gridbag = new GridBagLayout();
     GridBagConstraints c = new GridBagConstraints();
     setLayout(gridbag);
     c.gridwidth = GridBagConstraints.REMAINDER;
     add(speedSlider, c);
     c.gridwidth = 1;
     c.anchor = GridBagConstraints.CENTER;
     add(normal, c);
   } else {
     java.awt.BorderLayout layout = new java.awt.BorderLayout();
     layout.setVgap(0);
     setLayout(layout);
     add(speedSlider, java.awt.BorderLayout.CENTER);
     add(normal, java.awt.BorderLayout.EAST);
   }
   enableLabels(0);
 }
예제 #2
0
 public DummyMonitorWidget() {
   super();
   setOpaque(true);
   setBackground(InterfaceColors.MONITOR_BACKGROUND);
   setBorder(widgetBorder());
   org.nlogo.awt.Fonts.adjustDefaultFont(this);
 }