コード例 #1
0
 public void showOnlyTarget(boolean show) {
   oneToSource.setVisible(!show);
   allToSource.setVisible(!show);
   oneToTarget.setVisible(!show);
   allToTarget.setVisible(!show);
   sourceScroll.setVisible(!show);
 }
コード例 #2
0
ファイル: BasePane.java プロジェクト: Matsuzaki-s/DASTPlugin
  private void setButton() {
    JPanel buttonSpace = new JPanel();

    JButton back = new JButton("<");
    JButton next = new JButton(">");
    JButton first = new JButton("<<");
    JButton last = new JButton(">>");

    buttonSpace.setOpaque(true);
    buttonSpace.setBackground(Color.GRAY);
    buttonSpace.setLayout(new BoxLayout(buttonSpace, BoxLayout.X_AXIS));
    buttonSpace.setPreferredSize(new Dimension(this.getPreferredSize().width, 20));
    bsWidth = this.getPreferredSize().width;
    bsLength = 20;
    buttonSpace.setBounds(0, 0, bsWidth, bsLength);
    buttonSpace.setVisible(true);
    this.add(buttonSpace, JLayeredPane.DEFAULT_LAYER);
    buttonSpace.setOpaque(true);

    buttonSpace.add(first);
    buttonSpace.add(back);
    buttonSpace.add(next);
    buttonSpace.add(last);

    first.setVisible(true);
    back.setVisible(true);
    next.setVisible(true);
    last.setVisible(true);

    first.addActionListener(this);
    back.addActionListener(this);
    next.addActionListener(this);
    last.addActionListener(this);
  }
コード例 #3
0
  private JPanel createImageButtonsPanel() {
    replaceImageButton =
        new JButton(mainPanel.translate("button.replace"), View.getIcon("replaceimage16"));
    replaceImageButton.setMargin(new Insets(3, 3, 3, 10));
    replaceImageButton.addActionListener(mainPanel::replaceButtonActionPerformed);
    replaceImageButton.setVisible(false);

    replaceImageAlphaButton =
        new JButton(
            mainPanel.translate("button.replaceAlphaChannel"), View.getIcon("replacealpha16"));
    replaceImageAlphaButton.setMargin(new Insets(3, 3, 3, 10));
    replaceImageAlphaButton.addActionListener(mainPanel::replaceAlphaButtonActionPerformed);
    replaceImageAlphaButton.setVisible(false);

    prevFontsButton = new JButton(mainPanel.translate("button.prev"), View.getIcon("prev16"));
    prevFontsButton.setMargin(new Insets(3, 3, 3, 10));
    prevFontsButton.addActionListener(this::prevFontsButtonActionPerformed);
    prevFontsButton.setVisible(false);

    nextFontsButton = new JButton(mainPanel.translate("button.next"), View.getIcon("next16"));
    nextFontsButton.setMargin(new Insets(3, 3, 3, 10));
    nextFontsButton.addActionListener(this::nextFontsButtonActionPerformed);
    nextFontsButton.setVisible(false);

    ButtonsPanel imageButtonsPanel = new ButtonsPanel();
    imageButtonsPanel.add(replaceImageButton);
    imageButtonsPanel.add(replaceImageAlphaButton);
    imageButtonsPanel.add(prevFontsButton);
    imageButtonsPanel.add(nextFontsButton);
    return imageButtonsPanel;
  }
コード例 #4
0
  /**
   * This function takes the given customer or waiter object and changes the information panel to
   * hold that person's info.
   *
   * @param person customer or waiter object
   */
  public void updateInfoPanel(Object person) {
    stateCB.setVisible(true);
    changeOrder.setVisible(false);
    currentPerson = person;

    if (person instanceof CustomerAgent) {
      CustomerAgent customer = (CustomerAgent) person;
      stateCB.setText("Hungry?");
      changeOrder.setVisible(true);
      // changeOrder.setText("Change Order?");
      // changeOrder.setSelected(customer.waiter.requestingChange(customer));
      // changeOrder.setEnabled(!customer.waiter.requestingChange(customer));
      stateCB.setSelected(customer.isHungry());
      stateCB.setEnabled(!customer.isHungry());
      infoLabel.setText("<html><pre>     Name: " + customer.getName() + " </pre></html>");

    } else if (person instanceof WaiterAgent) {
      WaiterAgent waiter = (WaiterAgent) person;
      // stateCB.setText("On Break?");
      // stateCB.setSelected(waiter.isOnBreak());
      // stateCB.setEnabled(true);
      requestBreak.setVisible(true);
      stateCB.setVisible(false);
      changeOrder.setVisible(false);
      infoLabel.setText("<html><pre>     Name: " + waiter.getName() + " </html>");
    }

    infoPanel.validate();
  }
コード例 #5
0
ファイル: FloatCellEditor.java プロジェクト: r-h-o/rfDynHUD
  @Override
  protected void prepareComponent(
      JPanel component,
      HierarchicalTable<Property> table,
      Property property,
      Object value,
      boolean isSelected,
      boolean hasFocus,
      int row,
      int column,
      boolean forEditor) {
    super.prepareComponent(
        component, table, property, value, isSelected, hasFocus, row, column, forEditor);

    if (property.getButtonText() == null) {
      button.setVisible(false);
    } else {
      button.setVisible(true);
      button.setText(property.getButtonText());
      button.setToolTipText(property.getButtonTooltip());
    }

    if (isSelected && !forEditor) {
      textfield.setBackground(table.getSelectionBackground());
      textfield.setForeground(table.getSelectionForeground());
    } else {
      textfield.setBackground(table.getBackground());
      textfield.setForeground(table.getStyle().getValueCellFontColor());
    }
    panel.setBackground(textfield.getBackground());
    textfield.setFont(table.getStyle().getValueCellFont());
    textfield.setBorder(null);

    textfield.setText(FORMAT.format(value));
  }
コード例 #6
0
ファイル: Swing4.java プロジェクト: mc5827/Java-Programs
	public void actionPerformed(ActionEvent e)
	{
		if(e.getSource()==b)
		{
			temp=tf.getText();
			temp1[]=ta.getText().split();
			index=0;
			index=temp1[].indexOf(temp,index);
			ta.select(index, index+temp.length());
			b.setVisible(false);
			b1.setVisible(true);
		}
		if(e.getSource()==b1)
		{
			index=temp1.indexOf(temp,index+temp.length());
			if(index!=-1)
			{
				ta.requestFocusInWindow();
				ta.select(index, index+temp.length());
			}
			else
			{
				b.setVisible(true);
				b1.setVisible(false);
				index=0;
			}
		}
	}	
コード例 #7
0
ファイル: CardPanel.java プロジェクト: hawkinscm/Munchkin
  /**
   * Creates a new CardPanel panel.
   *
   * @param newCards cards that will be displayed
   * @param columns maximum number of cards that will be displayed on a horizontal axis
   * @param actionBtn button that will perform a preset function on the selected card; if null,
   *     button is not displayed
   * @param doneBtn button that will perform a preset function to finish with the card panel
   */
  public CardPanel(LinkedList<Card> newCards, int columns, JButton actionBtn, JButton doneBtn) {
    super();

    cards = newCards;
    maxColumns = columns;
    actionButton = actionBtn;
    if (actionButton == null) {
      actionButton =
          new CustomButton() {
            private static final long serialVersionUID = 1L;

            public void buttonPressed() {};
          };
      actionButton.setVisible(false);
    } else {
      actionButton.setEnabled(true);
      actionButton.setVisible(true);
    }

    doneButton = doneBtn;

    initializeCardDisplay();
    initializePanel();

    // if the number of cards is small, there is no need for a scroll pane, since all will be
    // visible
    if (cards.size() <= 1) {
      scrollPane.setVisible(false);
      validate();
      repaint();
    }
  }
 /** Esconde as opções de gerar relatório dados da janela <code>IgRelatorioFuncionario</code> */
 public void escondeOpcoesGerarRelatorio() {
   btnGerarRelatorio.setEnabled(false);
   btnBuscar.setVisible(true);
   btnAlterar.setVisible(false);
   loginTextField.setText("");
   relatorioEditorPane.setText("");
 }
コード例 #9
0
ファイル: DockPanel.java プロジェクト: NoSuchProcess/geogebra
  /** 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();
  }
コード例 #10
0
ファイル: ViewOperateUI.java プロジェクト: Goldenbullet/Code
  public ViewOperateUI(MainUIService main) {
    setLayout(null);
    m = main;
    this.setBounds(0, 0, 850, 700);
    this.setBackground(Color.WHITE);
    Font font2 = new Font("楷体", Font.BOLD, 18);

    JLabel title = new JLabel("经 营 状 态 表");
    title.setBounds(320, 30, 200, 40);
    title.setFont(font2);
    this.add(title);

    tabpane = new JTabbedPane(JTabbedPane.TOP);
    initPanelList();
    tabpane.setBounds(50, 80, tablewidth, tableheight);
    this.add(tabpane);

    Listener listen = new Listener();

    excel = new JButton("导出到Excel");
    excel.setBounds(250, 620, 150, 40);
    excel.setVisible(true);
    excel.setFont(new Font("隶书", Font.PLAIN, 20));
    excel.addMouseListener(listen);
    this.add(excel);

    exit = new JButton("返回");
    exit.setBounds(430, 620, 150, 40);
    exit.setVisible(true);
    exit.setFont(new Font("隶书", Font.PLAIN, 20));
    exit.addMouseListener(listen);
    this.add(exit);
  }
コード例 #11
0
 @Override
 public Component getListCellRendererComponent(
     JList<? extends E> list, E value, int index, boolean isSelected, boolean cellHasFocus) {
   label.setText(Objects.toString(value, ""));
   this.list = list;
   this.index = index;
   if (isSelected) {
     setBackground(list.getSelectionBackground());
     label.setForeground(list.getSelectionForeground());
   } else {
     setBackground(index % 2 == 0 ? EVEN_COLOR : list.getBackground());
     label.setForeground(list.getForeground());
   }
   MutableComboBoxModel m = (MutableComboBoxModel) list.getModel();
   if (index < 0 || m.getSize() - 1 <= 0) {
     setOpaque(false);
     deleteButton.setVisible(false);
     label.setForeground(list.getForeground());
   } else {
     boolean f = index == rolloverIndex;
     setOpaque(true);
     deleteButton.setVisible(true);
     deleteButton.getModel().setRollover(f);
     deleteButton.setForeground(f ? Color.WHITE : list.getForeground());
   }
   return this;
 }
コード例 #12
0
  /** Shuffle the numbers on the buttons */
  private void shuffle() {
    // Randomize the order
    if (solution) solution = false;
    else Collections.shuffle(current);

    // Reset the stats
    moves = 0;
    solved = false;

    // Reset each of the buttons to reflect the randomized
    // order
    for (int i = 0; i < buttons.size(); i++) {
      JButton b = (JButton) buttons.get(i);
      String value = (String) current.get(i);
      int val = Integer.parseInt(value) - 1;
      b.setText(value);
      b.setBackground(java.awt.Color.orange);
      b.setIcon(icons[val]);
      if (value.equals("16")) {
        b.setVisible(false);
        hiddenIndex = i;
      } else {
        b.setVisible(true);
      }
    }

    // Reset the status line
    getStatusLabel().setText("Number of moves: " + moves);
  }
コード例 #13
0
 public void setTrump(int dealer, String suit) {
   String theSuits = "";
   switch (suit) {
     case "H":
       theSuits = "Hearts";
       showCard("deck", "H");
       break;
     case "C":
       theSuits = "Clubs";
       showCard("deck", "C");
       break;
     case "S":
       theSuits = "Spades";
       showCard("deck", "S");
       break;
     case "D":
       theSuits = "Diamonds";
       showCard("deck", "D");
       break;
   }
   information.setText("Trump is: " + theSuits);
   if (dealer == playerNumber) {
     information.setText("Select throwaway card");
     setHand();
   } else {
     card1.setVisible(false);
     card2.setVisible(false);
     card3.setVisible(false);
     card4.setVisible(false);
     card5.setVisible(false);
   }
 }
コード例 #14
0
  private void mostrarConfirmación() {
    lblestsSeguroDe.setVisible(true);
    btnSi.setVisible(true);
    btnNo.setVisible(true);

    Ventana.getInstance().validate();
    Ventana.getInstance().repaint();
  }
コード例 #15
0
 private void deactivateTimeWarp() {
   gameUIManager.setEnabledAllWindows(true, this);
   message.setVisible(false);
   playFromHereButton.setVisible(false);
   returnButton.setVisible(false);
   timeWarpMode = false;
   closeable = true;
 }
コード例 #16
0
ファイル: GUI_menu.java プロジェクト: kolovsky/PT_SP
 // Method actionPerformed for button6
 private void cont() {
   Core.stop();
   button7.setEnabled(false);
   button7.setVisible(false);
   button6.setVisible(true);
   button6.setEnabled(true);
   button8.setEnabled(false);
 }
コード例 #17
0
  public void stop() {
    started = false;
    runner = null;

    startBtn.setText("Start");
    writeBtn.setVisible(true);
    paramsBtn.setVisible(true);
  }
コード例 #18
0
 public void showGenericTagPanel(Tag tag) {
   showCardLeft(GENERIC_TAG_CARD);
   genericEditButton.setVisible(true);
   genericSaveButton.setVisible(false);
   genericCancelButton.setVisible(false);
   genericTagPanel.setEditMode(false, tag);
   parametersPanel.setVisible(false);
 }
コード例 #19
0
  public void askDifficulty() {
    // hides everything but the things needed to be on the screen
    started = false;
    playing = false;

    instructionLabel.setVisible(true);
    difficultyLabel.setVisible(true);

    exitButton.setVisible(true);
    exitButton.setLocation((bWidth * 4) + 200, 450);

    for (int i = 0; i < 4; i++) {

      switch (i) {
        case (0):
          difficultyButton[i].setText("Easy");
          break;
        case (1):
          difficultyButton[i].setText("Medium");
          break;
        case (2):
          difficultyButton[i].setText("Hard");
          break;

        case (3):
          difficultyButton[i].setText("Insane");
          break;
      }

      difficultyButton[i].setVisible(true);
    }

    for (int i = 0; i < projectileAmount; i++) {
      enemyProj[i].setVisible(false);
    }

    for (int i = 0; i < livesImages.length; i++) {
      livesImages[i].setVisible(false);
    }

    playerLabel.setVisible(false);
    scoreLabel.setVisible(false);
    playerProj.setVisible(false);
    resetButton.setVisible(false);
    player.setVisible(false);
    outcomeLabel.setVisible(false);
    tickLabel.setVisible(false);
    shield.setVisible(false);
    ceiling.setVisible(false);
    floor.setVisible(false);

    for (int y = 0; y < 4; y++) {
      for (int x = 0; x < 10; x++) {
        enemies[y][x].setVisible(false);
      }
    }
  }
コード例 #20
0
 /**
  * To set the visibility of specific components in this class.
  *
  * @param isVisible whether to show or hide the specific components
  */
 private void setComponentsVisibility(boolean isVisible) {
   currentPageLabel.setVisible(isVisible);
   totalPageLabel.setVisible(isVisible);
   ofLabel.setVisible(isVisible);
   prevPageButton.setVisible(isVisible);
   nextPageButton.setVisible(isVisible);
   pageLabel.setVisible(isVisible);
   pageLabel2.setVisible(isVisible);
 }
コード例 #21
0
 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);
 }
コード例 #22
0
 private void updateMetadataButtonsVisibility() {
   boolean edit = metadataEditor.isEditable();
   boolean editorMode = Configuration.editorMode.get();
   metadataEditButton.setVisible(!edit);
   metadataSaveButton.setVisible(edit);
   boolean metadataModified = isMetadataModified();
   metadataCancelButton.setVisible(edit);
   metadataCancelButton.setEnabled(metadataModified || !editorMode);
 }
コード例 #23
0
ファイル: GUI_menu.java プロジェクト: kolovsky/PT_SP
 // Method actionPerformed for button7
 private void pause() {
   button6.setEnabled(false);
   button6.setVisible(false);
   button7.setVisible(true);
   button7.setEnabled(true);
   button8.setEnabled(true);
   Core.stop();
   // notifyAll();
 }
コード例 #24
0
 public void setEditMode(boolean val) {
   slotConstTraitPanel.setEditMode(val);
   methodTraitPanel.setEditMode(val);
   saveButton.setVisible(val);
   saveButton.setEnabled(false);
   editButton.setVisible(!val);
   cancelButton.setVisible(val);
   selectedLabel.setIcon(val ? View.getIcon("editing16") : null);
 }
コード例 #25
0
ファイル: Main.java プロジェクト: davidsjoo/chat_client
 public static void Initialize() {
   spConversation.setVisible(false);
   spUsersOnline.setVisible(false);
   messageField.setVisible(false);
   disconnect.setVisible(false);
   send.setVisible(false);
   userNameLabel.setVisible(true);
   userNameBox.setVisible(true);
   connectButton.setVisible(true);
 }
コード例 #26
0
ファイル: BorderLayoutFrame.java プロジェクト: ahmrf/GUI
 @Override
 public void actionPerformed(ActionEvent e) {
   for (JButton button : buttons) {
     if (e.getSource() == button) {
       button.setVisible(false);
     } else {
       button.setVisible(true);
     }
   }
 }
コード例 #27
0
 public void setPlayerControlsVisible(boolean b) {
   boolean oldValue = forwardButton.isVisible();
   if (oldValue != b) {
     forwardButton.setVisible(b);
     rewindButton.setVisible(b);
     startButton.setVisible(b);
     slider.setVisible(b);
     spacer.setVisible(!b);
     revalidate();
   }
 }
コード例 #28
0
  @Override
  public void actionPerformed(ActionEvent e) {
    if (emoticonButton == e.getSource()) {

    } else if (disCloseButton == e.getSource()) {
      disOpenButton.setVisible(true);
      disCloseButton.setVisible(false);
    } else if (disOpenButton == e.getSource()) {
      disOpenButton.setVisible(false);
      disCloseButton.setVisible(true);
    }
  }
コード例 #29
0
ファイル: ExitView.java プロジェクト: alvesl/Trab_inf1416
 // Set exit Message
 public void setMessage() {
   numLogedPasswd = AccessJDBC.getNumLogedPasswd(currentUser.getUsername());
   if (numLogedPasswd == 3) {
     lbMensagem.setText(
         "Sua senha está vencida."
             + "Para sair, é necessário ter uma senha pessoal válida para o próximo acesso.");
     btnSair.setVisible(false);
   } else {
     lbMensagem.setText("Pressione o botão Sair para confirmar");
     btnSair.setVisible(true);
   }
 }
コード例 #30
0
ファイル: LeftPanel.java プロジェクト: Iadgarov/BrainFreeze
  public static void refreshPatientData() {

    Measurements data = BrainFreezeMain.patients.get(BrainFreezeMain.currentPatientIndex).getData();

    if (data.isValid()) {

      resultChoiceList.setVisible(true); // we have valid data, show options for representation
      noDataText.setVisible(false);
      collectDataButton.setVisible(false);

      // Nothing chosen by definition, put up message
      RightPanel.swapRepresentation("ChooseSomethingMessage");

      resultChoiceList.addActionListener(
          new ActionListener() {

            @Override
            public void actionPerformed(ActionEvent e) {
              @SuppressWarnings("unchecked")
              JComboBox<String> cb = (JComboBox<String>) e.getSource();
              String chosenRepresentation = (String) cb.getSelectedItem();
              RightPanel.swapRepresentation(chosenRepresentation);
            }
          });

      collectDataButton.setVisible(true);
      collectDataButton.setText("Retake Exam");

      RightPanel.swapRepresentation(
          "~~"); // remove any graphs that may be there, this is a new patient with no valid data
      initComboBox(0);

      collectDataButton.removeActionListener(startExamListener);
      collectDataButton.addActionListener(retakeListener);

    } else {

      resultChoiceList.setVisible(false); // we have no valid data
      noDataText.setVisible(true);
      collectDataButton.setVisible(true);
      collectDataButton.setText("Begin Examination");

      RightPanel.swapRepresentation(
          "~~"); // remove any graphs that may be there, this is a new patient with no valid data

      collectDataButton.removeActionListener(retakeListener);
      collectDataButton.addActionListener(startExamListener);
    }

    editPatientInfoButton.addActionListener(editPatientInfoListener);
    editPatientInfoButton.setVisible(true);
  }