private void createControlPanel() {
    JPanel pnControls = new JPanel();
    pnCopies.add(pnControls, BorderLayout.NORTH);
    pnControls.setLayout(new MigLayout("", "[][grow][][]", "[]"));

    lblNrOfCopies = new JLabel();
    pnControls.add(lblNrOfCopies, "cell 0 0,alignx trailing");

    txtValNrOfCopies = new JTextField();
    txtValNrOfCopies.setEnabled(false);
    pnControls.add(txtValNrOfCopies, "flowx,cell 1 0");
    txtValNrOfCopies.setColumns(10);

    btnAdd = new JButton();
    btnAdd.setName(NAME_BUTTON_ADD_COPY);
    btnAdd.setMnemonic('a');
    btnAdd.setIcon(IconUtil.loadIcon("add.gif"));
    pnControls.add(btnAdd, "cell 2 0");

    btnRemove = new JButton();
    btnRemove.setName(NAME_BUTTON_DELETE_COPY);
    btnRemove.setEnabled(false);
    btnRemove.setMnemonic('e');
    btnRemove.setIcon(IconUtil.loadIcon("delete.gif"));
    pnControls.add(btnRemove, "cell 3 0");
  }
示例#2
0
 @Override
 public void actionPerformed(ActionEvent evt) {
   if (evt.getActionCommand().equals("buy")) {
     evt.setSource(getItem());
     listener.actionPerformed(evt);
   } else if (evt.getActionCommand().equals("fav")) {
     if (IDH.isFavorite(product)) {
       IDH.removeFavorite(product);
       if (list) {
         favButton.setIcon(
             new ImageIcon(ProductDisplay.class.getResource("/imat/resources/unfavmini.PNG")));
       } else {
         favButton.setIcon(
             new ImageIcon(ProductDisplay.class.getResource("/imat/resources/unfav.PNG")));
       }
       favButton.setToolTipText("Lägg till som favorit");
       listener.actionPerformed(evt);
     } else {
       IDH.addFavorite(product);
       if (list) {
         favButton.setIcon(
             new ImageIcon(ProductDisplay.class.getResource("/imat/resources/favmini.PNG")));
       } else {
         favButton.setIcon(
             new ImageIcon(ProductDisplay.class.getResource("/imat/resources/fav.PNG")));
       }
       listener.actionPerformed(evt);
       favButton.setToolTipText("Ta bort som favorit");
     }
     listener.actionPerformed(evt);
   }
 }
 public void setTrumpButtons(String unplayable) {
   Image c1 = setImage("H");
   card1.setIcon(new ImageIcon(c1));
   card1.setText(null);
   Image c2 = setImage("S");
   card2.setIcon(new ImageIcon(c2));
   card2.setText(null);
   Image c3 = setImage("D");
   card3.setIcon(new ImageIcon(c3));
   card3.setText(null);
   Image c4 = setImage("C");
   card4.setIcon(new ImageIcon(c4));
   card4.setText(null);
   card5.setText("Pass");
   card5.setIcon(null);
   switch (unplayable) {
     case "H":
       card1.setEnabled(false);
       break;
     case "S":
       card2.setEnabled(false);
       break;
     case "D":
       card3.setEnabled(false);
       break;
     case "C":
       card4.setEnabled(false);
       break;
   }
 }
  public void actionPerformed(ActionEvent ev) {
    if (collapsed) {
      if (label != null) {
        remove(label);
      }
      add(comp);
      moreOrLessButton.setIcon(collapseIcon);
    } else {
      remove(comp);
      if (valueLabelStr != null) {
        if (label == null) {
          label = new JLabel(Resources.format(Messages.CURRENT_VALUE, valueLabelStr));
        }
        add(label);
      }
      moreOrLessButton.setIcon(expandIcon);
    }
    collapsed = !collapsed;

    JComponent container = (JComponent) getParent();
    if (container != null && container.getLayout() instanceof VariableGridLayout) {

      ((VariableGridLayout) container.getLayout()).setFillRow(this, !collapsed);
      container.revalidate();
    }
  }
示例#5
0
  public ScrollViewport(int direction) {
    setLayout(new BorderLayout());

    JButton button;

    // UP
    if ((direction & UP_DIRECTION) > 0) {
      button = new JButton();
      button.addMouseListener(new ScrollViewPortMouseListener(UP_DIRECTION));
      button.setPreferredSize(new Dimension(10, 10));
      button.setIcon(ImageProvider.get("svpUp"));
      add(button, BorderLayout.NORTH);
      buttons.add(button);
    }

    // DOWN
    if ((direction & DOWN_DIRECTION) > 0) {
      button = new JButton();
      button.addMouseListener(new ScrollViewPortMouseListener(DOWN_DIRECTION));
      button.setPreferredSize(new Dimension(10, 10));
      button.setIcon(ImageProvider.get("svpDown"));
      add(button, BorderLayout.SOUTH);
      buttons.add(button);
    }

    // LEFT
    if ((direction & LEFT_DIRECTION) > 0) {
      button = new JButton();
      button.addMouseListener(new ScrollViewPortMouseListener(LEFT_DIRECTION));
      button.setPreferredSize(new Dimension(10, 10));
      button.setIcon(ImageProvider.get("svpLeft"));
      add(button, BorderLayout.WEST);
      buttons.add(button);
    }

    // RIGHT
    if ((direction & RIGHT_DIRECTION) > 0) {
      button = new JButton();
      button.addMouseListener(new ScrollViewPortMouseListener(RIGHT_DIRECTION));
      button.setPreferredSize(new Dimension(10, 10));
      button.setIcon(ImageProvider.get("svpRight"));
      add(button, BorderLayout.EAST);
      buttons.add(button);
    }

    add(vp, BorderLayout.CENTER);

    this.addComponentListener(
        new ComponentAdapter() {
          @Override
          public void componentResized(ComponentEvent e) {
            showOrHideButtons();
          }
        });

    showOrHideButtons();

    timer.setRepeats(true);
    timer.setInitialDelay(400);
  }
示例#6
0
 public void setInProgress(boolean visible) {
   if (visible) {
     stopButton.setIcon(stopOnIcon);
   } else {
     stopButton.setIcon(stopOffIcon);
   }
 }
 /**
  * Reset the image rollover icon as enabled/disabled.
  *
  * @param enabled, the status to draw the image rollover icon for.
  */
 public void updateImageRollover(boolean enabled) {
   if (enabled) {
     pbImageRollover.setIcon(UIImages.get(IMAGE_ROLLOVER_ICON));
   } else {
     pbImageRollover.setIcon(UIImages.get(IMAGE_ROLLOVEROFF_ICON));
   }
 }
示例#8
0
  private JPanel panelOpciones() {
    jlb_buscar = new JLabel("Buscar");
    jtf_buscar = new JTextField();
    jbtn_buscar = new JButton();
    jbtn_agregar = new JButton();

    jbtn_buscar.setIcon(iconos.getIcono(Iconos.ICON_BUSCAR));
    jbtn_agregar.setIcon(iconos.getIcono(Iconos.ICON_AGREGAR));

    jlb_buscar.setPreferredSize(new Dimension(50, 27));
    jtf_buscar.setPreferredSize(new Dimension(150, 27));
    jbtn_buscar.setPreferredSize(new Dimension(40, 27));
    jbtn_agregar.setPreferredSize(new Dimension(40, 27));

    JPanel pnlOpciones = new JPanel(new FlowLayout(FlowLayout.LEFT));
    pnlOpciones.setBorder(BorderFactory.createTitledBorder("Opciones"));
    pnlOpciones.setPreferredSize(new Dimension(-1, 60));

    pnlOpciones.add(jlb_buscar);
    pnlOpciones.add(jtf_buscar);
    pnlOpciones.add(jbtn_buscar);
    pnlOpciones.add(jbtn_agregar);

    return pnlOpciones;
  }
示例#9
0
  /**
   * Called when a property of the audio player changes. This will update the UI to reflect the
   * current state of the audio player.
   *
   * @param pce the property change event
   */
  private void handlePropertyChange(PropertyChangeEvent pce) {
    if (pce.getPropertyName().equals("playing")) {
      boolean playing = (Boolean) pce.getNewValue();
      if (playing) {
        playButton.setIcon(DataViewer.getIcon("icons/pause.gif"));

        if (!isVisible()) {
          setVisible(true);
        }
      } else {
        playButton.setIcon(DataViewer.getIcon("icons/audio_play.gif"));
      }
    } else if (pce.getPropertyName().equals("url")) {
      URL url = (URL) pce.getNewValue();
      if (url != null) {
        streamURLField.setText(url.toString());
      } else {
        streamURLField.setText(null);
      }
    } else if (pce.getPropertyName().equals("title")) {
      String title = (String) pce.getNewValue();
      if (title != null && title.length() > 0) {
        titleLabel.setText("<html><b>" + title + "</b> - Audio Player</html>");
      } else {
        titleLabel.setText("Audio Player");
      }
    }
  }
示例#10
0
 // Initialization this component
 private void jbInit() {
   this.getContentPane().setLayout(null);
   setTitle("Files selection");
   scriptFileChooser.setBounds(new Rectangle(5, 2, 485, 48));
   outputFileChooser.setBounds(new Rectangle(5, 38, 485, 48));
   comparisonFileChooser.setBounds(new Rectangle(5, 74, 485, 48));
   okButton.setToolTipText("OK");
   okButton.setIcon(okIcon);
   okButton.setBounds(new Rectangle(123, 134, 63, 44));
   okButton.addActionListener(
       new ActionListener() {
         public void actionPerformed(ActionEvent e) {
           okButton_actionPerformed(e);
         }
       });
   cancelButton.setBounds(new Rectangle(283, 134, 63, 44));
   cancelButton.addActionListener(
       new ActionListener() {
         public void actionPerformed(ActionEvent e) {
           cancelButton_actionPerformed(e);
         }
       });
   cancelButton.setToolTipText("CANCEL");
   cancelButton.setIcon(cancelIcon);
   this.getContentPane().add(scriptFileChooser, null);
   this.getContentPane().add(outputFileChooser, null);
   this.getContentPane().add(comparisonFileChooser, null);
   this.getContentPane().add(okButton, null);
   this.getContentPane().add(cancelButton, null);
   setSize(500, 210);
   setLocation(20, 415);
 }
示例#11
0
  /** Update all elements in the title bar. */
  public void updateTitleBar() {

    // The view is in the main window
    if (frame == null) {
      closeButton.setVisible(!isMaximized());
      windowButton.setVisible(false); // !isMaximized());
      unwindowButton.setVisible(false);
      unwindowButton2.setVisible(false);
      maximizeButton.setVisible(isMaximized());
      titleLabel.setVisible(true);

    } else {
      closeButton.setVisible(false);
      unwindowButton.setVisible(true);
      unwindowButton2.setVisible(true);
      windowButton.setVisible(false);
      maximizeButton.setVisible(false);
      titleLabel.setVisible(false);
    }

    if (isMaximized()) {
      maximizeButton.setIcon(app.getScaledIcon("view-unmaximize.png"));
    } else {
      maximizeButton.setIcon(app.getScaledIcon("view-maximize.png"));
    }

    updateLabels();
  }
示例#12
0
文件: Menu.java 项目: Rorkien/Ormus
  public Menu(ScriptPane parent) {
    setFloatable(false);
    add(newButton);
    add(openButton);
    add(saveButton);
    add(executeButton);
    add(preferencesButton);

    newButton.setToolTipText(Localization.getString("button.newfile.tooltip"));
    openButton.setToolTipText(Localization.getString("button.openfile.tooltip"));
    saveButton.setToolTipText(Localization.getString("button.savefile.tooltip"));
    executeButton.setToolTipText(Localization.getString("button.executefile.tooltip"));
    preferencesButton.setToolTipText(Localization.getString("button.preferences.tooltip"));

    newButton.setIcon(new ImageIcon(Resources.getImage("button.newfile")));
    openButton.setIcon(new ImageIcon(Resources.getImage("button.openfile")));
    saveButton.setIcon(new ImageIcon(Resources.getImage("button.savefile")));
    executeButton.setIcon(new ImageIcon(Resources.getImage("button.executefile")));
    preferencesButton.setIcon(new ImageIcon(Resources.getImage("button.preferences")));

    newButton.setActionCommand("new");
    openButton.setActionCommand("open");
    saveButton.setActionCommand("save");
    executeButton.setActionCommand("execute");
    preferencesButton.setActionCommand("preferences");

    newButton.addActionListener(parent);
    openButton.addActionListener(parent);
    saveButton.addActionListener(parent);
    executeButton.addActionListener(parent);
    preferencesButton.addActionListener(parent);
  }
示例#13
0
 @Override
 public void mouseExited(MouseEvent e) {
   Object obj = e.getSource();
   if (obj instanceof JButton) {
     JButton jbtn = (JButton) obj;
     if (jbtn == jsetup) {
       jbtn.setIcon(setup[0]);
     } else if (jbtn == jclose) {
       jbtn.setIcon(close[0]);
     } else if (jbtn == jmin) {
       jbtn.setIcon(min[0]);
     } else if (jbtn == jlogin) {
       jbtn.setIcon(loginImages[0]);
     }
   } else if (obj instanceof JLabel) {
     JLabel jbl = (JLabel) obj;
     if (jbl == register) {
       jbl.setIcon(regs[0]);
     } else if (jbl == minaFind) {
       jbl.setIcon(mina[0]);
     } else if (jbl == swit) {
       jbl.setIcon(swits[0]);
     } else if (jbl == right) {
       jbl.setIcon(rights[0]);
     }
   } else if (obj instanceof JCheckBox) {
     JCheckBox jcb = (JCheckBox) obj;
     if (!jcb.isSelected()) jcb.setIcon(remPwds[0]);
     else jcb.setSelectedIcon(remPwds[3]);
   }
 }
示例#14
0
    @Override
    public Component getTableCellRendererComponent(
        JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
      if (isSelected) {
        renderButton.setForeground(table.getSelectionForeground());
        renderButton.setBackground(table.getSelectionBackground());
      } else {
        renderButton.setForeground(table.getForeground());
        renderButton.setBackground(UIManager.getColor("Button.background"));
      }

      renderButton.setFocusPainted(hasFocus);

      if (value == null) {
        renderButton.setText("");
        renderButton.setIcon(null);
      } else if (value instanceof Icon) {
        renderButton.setText("");
        renderButton.setIcon((Icon) value);
      } else {
        renderButton.setText(value.toString());
        renderButton.setIcon(null);
      }
      return renderButton;
    }
示例#15
0
  private void initComponents() {
    addButton = new JButton(rb.getString("Button.Add"));
    addButton.setIcon(IconUtils.getIcon("/jgnash/resource/list-add.png"));
    addButton.setHorizontalTextPosition(SwingConstants.LEADING);

    removeButton = new JButton(rb.getString("Button.Remove"));
    removeButton.setIcon(IconUtils.getIcon("/jgnash/resource/list-remove.png"));

    aJList = new JList<>();
    cJList = new JList<>();

    helpPane = new JEditorPane();
    helpPane.setEditable(false);
    helpPane.setEditorKit(new StyledEditorKit());
    helpPane.setBackground(getBackground());
    helpPane.setText(TextResource.getString("NewFileThree.txt"));

    addComponentListener(
        new ComponentAdapter() {

          @Override
          public void componentHidden(ComponentEvent evt) {
            isPageValid();
          }
        });

    addButton.addActionListener(this);
    removeButton.addActionListener(this);
  }
示例#16
0
 @Override
 public void mouseReleased(MouseEvent e) {
   Object obj = e.getSource();
   if (obj instanceof JButton) {
     JButton jbtn = (JButton) obj;
     if (jbtn == jsetup) {
       jbtn.setIcon(setup[0]);
     } else if (jbtn == jclose) {
       jbtn.setIcon(close[0]);
     } else if (jbtn == jmin) {
       jbtn.setIcon(min[0]);
     } else if (jbtn == jlogin) {
       jbtn.setIcon(loginImages[0]);
     }
   } else if (obj instanceof JLabel) {
     JLabel jbl = (JLabel) obj;
     if (jbl == register) {
       jbl.setIcon(regs[0]);
     } else if (jbl == minaFind) {
       jbl.setIcon(mina[0]);
     } else if (jbl == swit) {
       jbl.setIcon(swits[0]);
     } else if (jbl == right) {
       jbl.setIcon(rights[0]);
     }
   }
 }
示例#17
0
 /**
  * Sets the {@link #encrypted} flag and modifies the icon of the {@link #encryptedButton}
  * accordingly.
  */
 private void encrypt() {
   if (!encryptedButton.isEnabled()) return;
   encrypted = !encrypted;
   IconManager icons = IconManager.getInstance();
   if (encrypted) encryptedButton.setIcon(icons.getIcon(IconManager.ENCRYPTED_24));
   else encryptedButton.setIcon(icons.getIcon(IconManager.DECRYPTED_24));
 }
示例#18
0
  /**
   * Move images so the one the user entered is moved to the only other empty one.
   *
   * <p>Just something else to do while wasting your time....
   *
   * @param entered the JButton user moved mouse into.
   */
  private void rotateImages(JButton entered) {
    // find Empty one.
    JButton buttons[] = {getNwButton(), getNeButton(), getSeButton(), getSwButton()};

    javax.swing.Icon selectedIcon = null;
    JButton emptyButton = null; // which one was empty.
    for (int i = 0; i < buttons.length; i++) {
      // button that mouse entered into; grab its image
      if (buttons[i] == entered) {
        selectedIcon = entered.getIcon();
      }

      if (buttons[i].getIcon() == null) {
        emptyButton = buttons[i];
      }
    }

    // if we get here, and emptyButton is one we entered, do nothing
    if (emptyButton == entered) {
      return;
    }

    // aha! Now swap entered one with the empty one.
    emptyButton.setIcon(selectedIcon);
    entered.setIcon(null); // clear away.
  }
示例#19
0
  public JPanel getSlicePanel() {

    final JPanel framePanel = new JPanel();
    framePanel.setAlignmentX(Component.LEFT_ALIGNMENT);
    framePanel.setAlignmentY(Component.TOP_ALIGNMENT);
    framePanel.setLayout(new BoxLayout(framePanel, BoxLayout.Y_AXIS));
    framePanel.setBorder(
        BorderFactory.createCompoundBorder(
            spaceY,
            new TitledBorder(
                null,
                Messages.getString("ImageTool.frame"), // $NON-NLS-1$
                TitledBorder.DEFAULT_JUSTIFICATION,
                TitledBorder.DEFAULT_POSITION,
                TITLE_FONT,
                TITLE_COLOR)));

    ActionState sequence = EventManager.getInstance().getAction(ActionW.SCROLL_SERIES);
    if (sequence instanceof SliderCineListener) {
      SliderCineListener cineAction = (SliderCineListener) sequence;
      final JSliderW frameSlider = cineAction.createSlider(4, true);
      framePanel.add(frameSlider.getParent());

      final JPanel panel_3 = new JPanel();
      panel_3.setLayout(new FlowLayout(FlowLayout.LEFT, 3, 3));
      final JLabel speedLabel = new JLabel();
      speedLabel.setText(
          Messages.getString("ImageTool.cine_speed") + StringUtil.COLON); // $NON-NLS-1$
      panel_3.add(speedLabel);

      final JSpinner speedSpinner = new JSpinner(cineAction.getSpeedModel());
      JMVUtils.formatCheckAction(speedSpinner);
      panel_3.add(speedSpinner);
      final JButton startButton = new JButton();
      startButton.setActionCommand(ActionW.CINESTART.cmd());
      startButton.setPreferredSize(JMVUtils.getBigIconButtonSize());
      startButton.setToolTipText(Messages.getString("ImageTool.cine_start")); // $NON-NLS-1$
      startButton.setIcon(
          new ImageIcon(
              MouseActions.class.getResource(
                  "/icon/22x22/media-playback-start.png"))); //$NON-NLS-1$
      startButton.addActionListener(EventManager.getInstance());
      panel_3.add(startButton);
      cineAction.registerActionState(startButton);

      final JButton stopButton = new JButton();
      stopButton.setActionCommand(ActionW.CINESTOP.cmd());
      stopButton.setPreferredSize(JMVUtils.getBigIconButtonSize());
      stopButton.setToolTipText(Messages.getString("ImageTool.cine_stop")); // $NON-NLS-1$
      stopButton.setIcon(
          new ImageIcon(
              MouseActions.class.getResource(
                  "/icon/22x22/media-playback-stop.png"))); //$NON-NLS-1$
      stopButton.addActionListener(EventManager.getInstance());
      panel_3.add(stopButton);
      cineAction.registerActionState(stopButton);
      framePanel.add(panel_3);
    }
    return framePanel;
  }
示例#20
0
  /** Updates the channel settings. This method is invoked when changes to the channel were made. */
  private void updateChannelInfo() {
    SamplerChannel sc = getChannelInfo();

    int status = sc.getInstrumentStatus();
    if (status >= 0 && status < 100) {
      btnInstr.setText(i18n.getLabel("Channel.loadingInstrument", status));
    } else if (status == -1) {
      btnInstr.setText(i18n.getLabel("Channel.btnInstr"));
    } else if (status < -1) {
      btnInstr.setText(i18n.getLabel("Channel.errorLoadingInstrument"));
    } else {
      if (sc.getInstrumentName() != null) btnInstr.setText(sc.getInstrumentName());
      else btnInstr.setText(i18n.getLabel("Channel.btnInstr"));
    }

    updateMuteIcon(sc);

    if (sc.isSoloChannel()) btnSolo.setIcon(iconSoloOn);
    else btnSolo.setIcon(iconSoloOff);

    slVolume.setValue((int) (sc.getVolume() * 100));

    boolean b = sc.getEngine() != null;
    slVolume.setEnabled(b);
    btnSolo.setEnabled(b);
    btnMute.setEnabled(b);
  }
示例#21
0
  private void initComponents() {
    setTitle("Print Preview");
    sheetBox.setRenderer(
        new DefaultListCellRenderer() {

          @Override
          public Component getListCellRendererComponent(
              JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
            super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
            if (value != null) {
              setToolTipText(value.toString());
            }
            return this;
          }
        });
    sheetBox.setActionCommand(SHEET_COMMAND);
    sheetBox.addActionListener(this);
    pageBox.addItem("0 of 0");
    pageBox.setActionCommand(PAGE_COMMAND);
    pageBox.addActionListener(this);
    zoomBox.addItem(0.25);
    zoomBox.addItem(0.50);

    zoomBox.addItem(0.75);
    zoomBox.addItem(1.00);
    zoomBox.setSelectedItem(0.75);
    zoomBox.setRenderer(
        new DefaultListCellRenderer() {

          @Override
          public Component getListCellRendererComponent(
              JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
            NumberFormat format = NumberFormat.getPercentInstance();
            value = format.format(value);
            return super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
          }
        });
    zoomBox.setEditable(true);
    zoomBox.setEditor(new PercentEditor(zoomBox));
    zoomBox.setActionCommand(ZOOM_COMMAND);
    zoomBox.addActionListener(this);
    zoomInButton.setIcon(Icons.ZoomIn16.getImageIcon());
    zoomInButton.setActionCommand(ZOOM_IN_COMMAND);
    zoomInButton.addActionListener(this);
    zoomOutButton.setIcon(Icons.ZoomOut16.getImageIcon());
    zoomOutButton.setActionCommand(ZOOM_OUT_COMMAND);
    zoomOutButton.addActionListener(this);

    printButton.setText("Print");
    printButton.setActionCommand(PRINT_COMMAND);
    printButton.addActionListener(this);

    cancelButton.setText("Cancel");
    cancelButton.setActionCommand(CANCEL_COMMAND);
    cancelButton.addActionListener(this);

    enableEditGroup(false);

    Utility.installEscapeCloseOperation(this);
  }
 private void updateButton() {
   if (visible) {
     toggleVisibility.setIcon(contentVisible);
   } else {
     toggleVisibility.setIcon(contentInVisible);
   }
 }
示例#23
0
  /** Update the SKIN for the GUI. */
  public void updateGUISkin(Skin newSkin) {
    if (newSkin == null) return;

    nwButton.setIcon(newSkin.icons()[0]);
    neButton.setIcon(newSkin.icons()[1]);
    seButton.setIcon(newSkin.icons()[2]);
    swButton.setIcon(null);
  }
示例#24
0
  /** Reloads button resources. */
  public void loadSkin() {
    addButton.setIcon(
        GuiActivator.getResources().getImage("service.gui.icons.ADD_CONTACT_16x16_ICON"));
    callButton.setIcon(GuiActivator.getResources().getImage("service.gui.icons.CALL_16x16_ICON"));

    if (smsButton != null)
      smsButton.setIcon(GuiActivator.getResources().getImage("service.gui.icons.SMS_BUTTON_ICON"));
  }
 protected void setShowAlternation(boolean isSelected) {
   if (isSelected) {
     alternationBtn.setIcon(UIImages.ALT_ROWS.getImageIcon());
     alternationBtn.setText(STLConstants.K0532_ALT_ROWS.getValue());
   } else {
     alternationBtn.setIcon(UIImages.UNI_ROWS.getImageIcon());
     alternationBtn.setText(STLConstants.K0533_UNI_ROWS.getValue());
   }
 }
示例#26
0
  public void setPanelVisible(boolean viewPanelVisibility) {
    controlPanel.setVisible(viewPanelVisibility);

    if (viewPanelVisibility) {
      panelToggleButton.setIcon(downIcon);
    } else {
      panelToggleButton.setIcon(upIcon);
    }
  }
 protected void setShowBorder(boolean isSelected) {
   if (isSelected) {
     borderBtn.setIcon(UIImages.SHOW_BORDER.getImageIcon());
     borderBtn.setText(STLConstants.K0530_SHOW_BORDER.getValue());
   } else {
     borderBtn.setIcon(UIImages.HIDE_BORDER.getImageIcon());
     borderBtn.setText(STLConstants.K0531_HIDE_BORDER.getValue());
   }
 }
 public void orderUp() {
   card1.setVisible(false);
   card3.setVisible(false);
   card5.setVisible(false);
   card2.setText("Order Up");
   card2.setIcon(null);
   card4.setText("Pass");
   card4.setIcon(null);
 }
  public PromotionDialog(Square location) {
    // Creating promotion dialog
    if (Board.getBoard().isWhiteMove()) {
      setTitle(
          "Promotion for " + Board.getBoard().getWhitePlayer().getName() + " - Choose a figure");
    } else {
      setTitle(
          "Promotion for " + Board.getBoard().getBlackPlayer().getName() + " - Choose a figure");
    }

    this.location = location;
    JPanel pane = (JPanel) getContentPane();
    pane.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
    pane.setLayout(new GridLayout(1, 4, 10, 10));

    JButton rookButton = new JButton();
    rookButton.setIcon(rook.getFigureIcon());
    rookButton.addActionListener(this);
    rookButton.setFocusPainted(false);
    pane.add(rookButton);

    JButton knightButton = new JButton();
    knightButton.setIcon(knight.getFigureIcon());
    knightButton.addActionListener(this);
    knightButton.setFocusPainted(false);
    pane.add(knightButton);

    JButton bishopButton = new JButton();
    bishopButton.setIcon(bishop.getFigureIcon());
    bishopButton.addActionListener(this);
    bishopButton.setFocusPainted(false);
    pane.add(bishopButton);

    JButton queenButton = new JButton();
    queenButton.setIcon(queen.getFigureIcon());
    queenButton.addActionListener(this);
    queenButton.setFocusPainted(false);
    pane.add(queenButton);

    // Has to choose
    setDefaultCloseOperation(JDialog.DO_NOTHING_ON_CLOSE);
    // Set to be always on top
    setAlwaysOnTop(true); // http://goo.gl/h3vnma
    // Makes dialog customizable
    setModal(true);
    // Disable resize
    setResizable(false);
    // Makes the dialog like an application (with swing components, etc.)
    setModalityType(ModalityType.APPLICATION_MODAL);
    // Size of dialog
    setMinimumSize(new Dimension(300, 100));
    // Centering by default
    setLocationRelativeTo(null);
    pack();
    setVisible(true);
  }
示例#30
0
 public void setConnectionStatus(String status) {
   btnConnectionTest.setIcon(UIImages.PLAY.getImageIcon());
   btnConnectionTest.setSelected(false);
   lblConnectionStatus.setIcon(null);
   Color color =
       (status.equals(STLConstants.K3031_PASS.getValue()))
           ? UIConstants.DARK_GREEN
           : UIConstants.INTEL_RED;
   setLabel(lblConnectionStatus, status, color);
   btnConnectionTest.setIcon(UIImages.PLAY.getImageIcon());
 }