예제 #1
0
  OpFooter(OpControl control, List<LayerMode> layerModes) {
    super(BoxLayout.X_AXIS);

    layerControls = new LayerControls(control, layerModes, pcs);
    invertRegionSwitch = new InvertRegionCheckBox(control, pcs);
    colorControls = new ColorSelectionControls(control, pcs);

    Box blendBox = Box.createVerticalBox();
    blendBox.add(Box.createVerticalStrut(5));
    blendBox.add(layerControls);
    blendBox.add(invertRegionSwitch);
    blendBox.setBackground(LightZoneSkin.Colors.ToolPanesBackground);
    layerControls.setAlignmentX(Component.LEFT_ALIGNMENT);
    invertRegionSwitch.setAlignmentX(Component.LEFT_ALIGNMENT);

    tabPane = new JTabbedPane();
    tabPane.setFont(LightZoneSkin.fontSet.getSmallFont());
    tabPane.add(LOCALE.get("ToolSettingsTabName"), blendBox);
    tabPane.add(LOCALE.get("ColorSelectionTabName"), colorControls);

    tabPane.setIconAt(0, getThemeIcon(orangeScheme, true));
    tabPane.setIconAt(1, getThemeIcon(orangeScheme, false));

    add(tabPane, BorderLayout.NORTH);

    setBackground(LightZoneSkin.Colors.ToolPanesBackground);

    pcs.addPropertyChangeListener(this);
  }
  public synchronized void toggleCurrentSQLResultTabSticky() {
    if (null != _stickyTab) {
      if (_stickyTab.equals(_tabbedExecutionsPanel.getSelectedComponent())) {
        // Sticky is turned off. Just remove sticky and return.
        _stickyTab = null;
        _tabbedExecutionsPanel.setIconAt(_tabbedExecutionsPanel.getSelectedIndex(), null);
        return;

      } else {
        // remove old sticky tab
        int indexOfStickyTab = getIndexOfTab(_stickyTab);
        if (-1 != indexOfStickyTab) {
          _tabbedExecutionsPanel.setIconAt(indexOfStickyTab, null);
        }
        _stickyTab = null;
      }
    }

    if (false == _tabbedExecutionsPanel.getSelectedComponent() instanceof IResultTab) {
      // i18n[SQLResultExecuterPanel.nonStickyPanel=Cannot make a cancel panel sticky]
      String msg = s_stringMgr.getString("SQLResultExecuterPanel.nonStickyPanel");
      JOptionPane.showMessageDialog(_session.getApplication().getMainFrame(), msg);
      return;
    }

    _stickyTab = (IResultTab) _tabbedExecutionsPanel.getSelectedComponent();
    int selectedIndex = _tabbedExecutionsPanel.getSelectedIndex();

    ImageIcon icon = getStickyIcon();

    _tabbedExecutionsPanel.setIconAt(selectedIndex, icon);
  }
예제 #3
0
 public void propertyChange(PropertyChangeEvent evt) {
   if (tabPane != null && evt.getPropertyName().equals(ColorSelectionControls.COLOR_SELECTION)) {
     if (evt.getNewValue() == Boolean.TRUE) tabPane.setIconAt(1, getThemeIcon(null, false));
     else tabPane.setIconAt(1, getThemeIcon(orangeScheme, false));
   }
   if (layerControls != null && evt.getPropertyName().equals(LayerControls.BLENDING_MODES)) {
     if (evt.getNewValue() == Boolean.TRUE) tabPane.setIconAt(0, getThemeIcon(null, true));
     else tabPane.setIconAt(0, getThemeIcon(orangeScheme, true));
   }
 }