예제 #1
0
  private void generateContent(JPanel buttonJP) {

    buttonJP.setLayout(new BoxLayout(buttonJP, BoxLayout.LINE_AXIS));
    buttonJP.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));

    JButton save = new JButton("Save");
    save.setSize(100, 50);
    save.setMaximumSize(save.getSize());
    save.addMouseListener(generateSaveMouseListener());
    save.setFocusable(false);

    JButton load = new JButton("Load");
    load.setSize(100, 50);
    load.setMaximumSize(load.getSize());
    load.addMouseListener(generateLoadMouseListener());
    load.setFocusable(false);

    this.fileNameTF = new JTextField();
    this.fileNameTF.setSize(190, 50);
    this.fileNameTF.setMaximumSize(this.fileNameTF.getSize());
    this.fileNameTF.setText("Mr.Freezer");

    buttonJP.add(save);
    buttonJP.add(Box.createRigidArea(new Dimension(10, 0)));
    buttonJP.add(load);
    buttonJP.add(Box.createRigidArea(new Dimension(10, 0)));
    buttonJP.add(this.fileNameTF);
  }
예제 #2
0
  /**
   * Sets the combo-boxes to a fixed size so they don't take up too much room that would be better
   * devoted to the test output box
   */
  protected void setComboSizes() {

    m_DatasetKeyBut.setPreferredSize(COMBO_SIZE);
    m_RunCombo.setPreferredSize(COMBO_SIZE);
    m_ResultKeyBut.setPreferredSize(COMBO_SIZE);
    m_CompareCombo.setPreferredSize(COMBO_SIZE);
    m_SigTex.setPreferredSize(COMBO_SIZE);

    m_DatasetKeyBut.setMaximumSize(COMBO_SIZE);
    m_RunCombo.setMaximumSize(COMBO_SIZE);
    m_ResultKeyBut.setMaximumSize(COMBO_SIZE);
    m_CompareCombo.setMaximumSize(COMBO_SIZE);
    m_SigTex.setMaximumSize(COMBO_SIZE);

    m_DatasetKeyBut.setMinimumSize(COMBO_SIZE);
    m_RunCombo.setMinimumSize(COMBO_SIZE);
    m_ResultKeyBut.setMinimumSize(COMBO_SIZE);
    m_CompareCombo.setMinimumSize(COMBO_SIZE);
    m_SigTex.setMinimumSize(COMBO_SIZE);

    // =============== BEGIN EDIT melville ===============
    m_PrecTex.setPreferredSize(COMBO_SIZE);
    m_PrecTex.setMaximumSize(COMBO_SIZE);
    m_PrecTex.setMinimumSize(COMBO_SIZE);
    // =============== END EDIT melville ===============
  }
예제 #3
0
  public void prepareGUI() {
    mainFrame = new JFrame("Game of life");
    mainFrame.setSize(750, 670);
    mainFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

    grid = new GridPanel(board.getNumOfRows(), board.getNumOfColumns());
    grid.setPreferredSize(new Dimension(600, 600));
    grid.setBoard(this.board.getCurrentRound());
    grid.addMouseListener(this);

    scrollPane = new JScrollPane(grid);
    scrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS);
    scrollPane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);

    buttonStart = new JButton("Start");
    buttonStop = new JButton("Stop");
    buttonNextRound = new JButton("Next round");
    buttonClearBoard = new JButton("Clear board");

    buttonStart.setMaximumSize(
        new Dimension(Integer.MAX_VALUE, buttonStart.getMinimumSize().height));
    buttonStop.setMaximumSize(new Dimension(Integer.MAX_VALUE, buttonStop.getMinimumSize().height));
    buttonNextRound.setMaximumSize(
        new Dimension(Integer.MAX_VALUE, buttonNextRound.getMinimumSize().height));
    buttonClearBoard.setMaximumSize(
        new Dimension(Integer.MAX_VALUE, buttonClearBoard.getMinimumSize().height));

    buttonStart.addActionListener(this);
    buttonStop.addActionListener(this);
    buttonNextRound.addActionListener(this);
    buttonClearBoard.addActionListener(this);

    generationsLabel = new JLabel("Generation " + numOfGenerations);

    drawingCheckBox = new JCheckBox("Drawing");

    buttonsPanel = new JPanel();
    buttonsPanel.setLayout(new BoxLayout(buttonsPanel, BoxLayout.PAGE_AXIS));
    buttonsPanel.add(buttonStart);
    buttonsPanel.add(Box.createVerticalStrut(2));
    buttonsPanel.add(buttonStop);
    buttonsPanel.add(Box.createVerticalStrut(2));
    buttonsPanel.add(buttonNextRound);
    buttonsPanel.add(Box.createVerticalStrut(2));
    buttonsPanel.add(buttonClearBoard);
    buttonsPanel.add(Box.createVerticalStrut(2));
    buttonsPanel.add(generationsLabel);
    buttonsPanel.add(Box.createVerticalStrut(2));
    buttonsPanel.add(drawingCheckBox);

    mainFrame.add(scrollPane, BorderLayout.CENTER);
    mainFrame.add(buttonsPanel, BorderLayout.EAST);
  }
  public InOut() {
    sdf = new SimpleDateFormat("HH:mm:ss");
    list = new ArrayList<Attendance>();
    // reading data in list
    try {
      list = AttendanceStorge.readingFromUserAttendanceDB();
    } catch (Exception e) {
      JOptionPane.showMessageDialog(btnintime, "File not found");
    }

    // GUI INTERFACE
    btnadimlogin = new JButton("      Work as Admin      ");
    btninfo = new JButton("Employee Information");
    btnintime = new JButton("IN Time");
    btnchangepass = new JButton("Change Password");
    btnintime.setMaximumSize(btninfo.getMaximumSize());
    btnouttime = new JButton("OUT Time");
    btnchangepass.setMaximumSize(btninfo.getMaximumSize());
    btnouttime.setMaximumSize(btninfo.getMaximumSize());
    btnleaverequest = new JButton("Leave Request");
    btnleaverequest.setMaximumSize(btninfo.getMaximumSize());
    boxbutton = Box.createVerticalBox();
    boxbutton.add(Box.createRigidArea(new Dimension(60, 20)));
    boxbutton.add(btnintime);
    boxbutton.add(Box.createRigidArea(new Dimension(60, 20)));
    boxbutton.add(btnouttime);
    boxbutton.add(Box.createRigidArea(new Dimension(60, 20)));
    boxbutton.add(btnleaverequest);
    boxbutton.add(Box.createRigidArea(new Dimension(60, 20)));
    boxbutton.add(btnchangepass);
    boxbutton.add(Box.createRigidArea(new Dimension(60, 20)));
    boxbutton.add(btnadimlogin);

    btnintime.addActionListener(this);
    btnouttime.addActionListener(this);
    btnleaverequest.addActionListener(this);
    btnchangepass.addActionListener(this);
    btnadimlogin.addActionListener(this);
    add(boxbutton, BorderLayout.CENTER);
    setSize(240, 290);
    setVisible(true);
    setTitle("ATTENDENCE");
    setLocationRelativeTo(null);
    setResizable(false);

    // button enable check
    initialdata();
  }
예제 #5
0
  /**
   * Create a new tab to the FlexiBar, with the specified title and the specified component inside
   * the tab.
   *
   * @param title the title of the tab to be added
   * @param comp the component inserted in the tab
   */
  public void add(String title, JComponent comp) {
    JButton button = new JButton(title);
    button.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent arg0) {
            System.out.println("click");
            setSelected((JButton) arg0.getSource());
          }
        });
    button.setMinimumSize(new Dimension(this.B_WIDTH, this.B_HEIGHT));
    button.setMaximumSize(new Dimension(this.B_WIDTH, this.B_HEIGHT));
    button.setPreferredSize(new Dimension(this.B_WIDTH, this.B_HEIGHT));
    button.setAlignmentX(LEFT_ALIGNMENT);
    comp.setMinimumSize(new Dimension(this.P_WIDTH, this.P_HEIGHT));
    comp.setMaximumSize(new Dimension(this.P_WIDTH, this.P_HEIGHT));
    // comp.setPreferredSize(new Dimension(this.P_WIDTH,this.P_HEIGHT));
    comp.setAlignmentX(LEFT_ALIGNMENT);
    if (currentSelected == -1) {
      comp.setVisible(true);
      currentSelected = 0;
    } else comp.setVisible(false);

    listComponent.add(button);
    listComponent.add(comp);

    panel.add(button);
    panel.add(comp);
  }
예제 #6
0
  private void listPeople() {

    try {

      jScrollPane1.getViewport().setView(null);

      JFlowPanel jPeople = new JFlowPanel();
      jPeople.applyComponentOrientation(getComponentOrientation());

      java.util.List people = m_dlSystem.listPeopleVisible();

      for (int i = 0; i < people.size(); i++) {

        AppUser user = (AppUser) people.get(i);

        JButton btn = new JButton(new AppUserAction(user));
        btn.applyComponentOrientation(getComponentOrientation());
        btn.setFocusPainted(false);
        btn.setFocusable(false);
        btn.setRequestFocusEnabled(false);
        btn.setHorizontalAlignment(SwingConstants.LEADING);
        btn.setMaximumSize(new Dimension(150, 50));
        btn.setPreferredSize(new Dimension(150, 50));
        btn.setMinimumSize(new Dimension(150, 50));

        jPeople.add(btn);
      }
      jScrollPane1.getViewport().setView(jPeople);

    } catch (BasicException ee) {
      ee.printStackTrace();
    }
  }
예제 #7
0
 /**
  * Creates a new button with manageable width.
  *
  * @param aText Text of the button.
  * @param aTooltip Tooltip text for the button. Set this to <code>null</code> if no tooltip is to
  *     be displayed.
  * @param aListener Button click's listener.
  * @return Newly created instance of <code>JButton</code>.
  */
 public static JButton createButton(String aText, String aTooltip, ActionListener aListener) {
   JButton button = new JButton(aText);
   button.setToolTipText(aTooltip);
   button.addActionListener(aListener);
   button.setMaximumSize(new Dimension(Short.MAX_VALUE, button.getHeight()));
   return button;
 }
예제 #8
0
  private JButton createButton(String text, String eventid, String shortcut, boolean def) {
    final JButton b = new JButton(text);
    b.setMaximumSize(new Dimension(80, b.getPreferredSize().height));
    b.setPreferredSize(new Dimension(80, b.getPreferredSize().height));
    b.setMinimumSize(new Dimension(80, b.getPreferredSize().height));
    b.setActionCommand(eventid);
    b.addActionListener(this);
    b.setMnemonic(shortcut.charAt(0));
    if ((shortcut != null) && (shortcut.length() > 0)) {
      this.eventKeyMap.put(Character.valueOf(shortcut.charAt(0)), eventid);
    }
    if (def) {
      getRootPane().setDefaultButton(b);
      b.requestFocus();
      addWindowListener(
          new WindowAdapter() {

            @Override
            public void windowActivated(WindowEvent e) {
              b.requestFocusInWindow();
            }
          });
    }
    b.addKeyListener(this.keyListener);
    SubstanceThemeHelper.setComponentToGeneralArea(b);
    return b;
  }
  public static JPanel createSelected(final JTextField textField, final JButton... btns) {
    final Dimension btnDim = new Dimension(18, 18);
    initComponentHeight(textField);
    final JPanel jp = new JPanel(new GridBagLayout());
    jp.setBorder(textField.getBorder());
    textField.setBorder(BorderFactory.createEmptyBorder());
    jp.setPreferredSize(textField.getPreferredSize());
    final GridBagConstraints gbc = new GridBagConstraints();
    gbc.gridx = 0;
    gbc.gridy = 0;
    gbc.weightx = 1.0;
    gbc.weighty = 1.0;
    gbc.fill = GridBagConstraints.BOTH;
    jp.add(textField, gbc);

    gbc.weightx = 0.0;
    if (btns != null) {
      for (final JButton btn : btns) {
        gbc.gridx++;
        btn.setMaximumSize(btnDim);
        btn.setMinimumSize(btnDim);
        btn.setPreferredSize(btnDim);
        btn.setText("..");
        jp.add(btn, gbc);
      }
    }
    return jp;
  }
  private LabeledComponent getGroupLabeledComponent() {
    if (groupLabeledComponent == null) {
      ListPanel pnl = getGroupListPanel();
      groupLabeledComponent = new LabeledComponent("Queries", new JScrollPane(pnl));
      groupLabeledComponent.setBorder(
          BorderFactory.createCompoundBorder(
              BorderFactory.createEmptyBorder(0, 2, 0, 2),
              BorderFactory.createLoweredBevelBorder()));

      JButton btn2 =
          groupLabeledComponent.addHeaderButton(
              new AbstractAction("Add Negated Query", Icons.getAddQueryLibraryIcon()) {
                public void actionPerformed(ActionEvent e) {
                  addNegatedQueryComponent();
                }
              });
      btn2.setText("Add Negated Query");
      // have to change the sizes to show the text
      final Dimension dim2 = new Dimension(100, btn2.getPreferredSize().height);
      btn2.setMinimumSize(dim2);
      btn2.setPreferredSize(dim2);
      btn2.setMaximumSize(dim2);

      JButton btn =
          groupLabeledComponent.addHeaderButton(
              new AbstractAction("Add another query", Icons.getAddQueryLibraryIcon()) {
                public void actionPerformed(ActionEvent e) {
                  addQueryComponent();
                }
              });
      btn.setText("Add Query");
      // have to change the sizes to show the text
      final Dimension dim = new Dimension(100, btn.getPreferredSize().height);
      btn.setMinimumSize(dim);
      btn.setPreferredSize(dim);
      btn.setMaximumSize(dim);

      btnAndQuery = new JRadioButton("Match All ", false);
      btnOrQuery = new JRadioButton("Match Any ", true);
      btn.getParent().add(btnAndQuery);
      btn.getParent().add(btnOrQuery);
      ButtonGroup group = new ButtonGroup();
      group.add(btnAndQuery);
      group.add(btnOrQuery);
    }
    return groupLabeledComponent;
  }
예제 #11
0
  /** Constructor. */
  public SaveFileType() {
    VBoxLayout layout = new VBoxLayout(this, VBoxLayout.Y_AXIS);

    setLayout(layout);

    setLayoutType(LayoutType.STATIC);

    nameLabel.setText("File Name:");
    nameLabel.setAlignmentX(0.0f);

    this.add(nameLabel);

    input = new VTextField(this, "");
    input.setHorizontalAlignment(JTextField.LEFT);

    setInputDocument(input, input.getDocument());

    int height = (int) this.input.getMinimumSize().getHeight();
    this.input.setSize(new Dimension(120, height));
    this.input.setMinimumSize(new Dimension(120, height));
    this.input.setMaximumSize(new Dimension(120, height));
    this.input.setPreferredSize(new Dimension(120, height));

    input.setAlignmentY(0.5f);
    input.setAlignmentX(0.0f);

    this.add(input);

    final FileDialogManager fileManager = new FileDialogManager();

    JButton button = new JButton("...");

    button.setMaximumSize(new Dimension(50, button.getMinimumSize().height));

    button.addActionListener(
        new ActionListener() {

          @Override
          public void actionPerformed(ActionEvent e) {
            File directory = null;
            if (getViewValueWithoutValidation() != null) {
              directory = new File(getViewValueWithoutValidation().toString());
              if (!directory.isDirectory()) {
                directory = directory.getParentFile();
              }
            }
            file = fileManager.getSaveFile(getMainCanvas(), directory, getFileFilter(), false);
            if (file != null) {
              input.setText(file.toString());
              input.setCaretPosition(input.getText().length());
              input.setToolTipText(file.toString());
            }
          }
        });

    this.add(button);
  }
예제 #12
0
  // constructor of TextFrame
  public TextFrame() {
    // this.message = message;
    message = "Click to Edit Text";
    messageFont = new Font("Arial", Font.PLAIN, 30);
    foreground = Color.black;
    background = Color.white;

    // custom dialog (it's a private class inside TextFrame)
    cd = new CustomDialog(this);

    messageField = new JTextField();
    messageField.setPreferredSize(new Dimension(300, 200));
    messageField.setEditable(false);
    messageField.setHorizontalAlignment(SwingConstants.CENTER);
    messageField.setAlignmentX(Component.CENTER_ALIGNMENT);
    updateMessage();

    customize = new JButton("Customize");
    customize.setMaximumSize(customize.getPreferredSize());
    customize.setAlignmentX(Component.CENTER_ALIGNMENT);

    apply = new JButton("Apply");
    apply.setMaximumSize(customize.getPreferredSize());
    apply.setAlignmentX(Component.CENTER_ALIGNMENT);

    /*add the listeners*/
    customize.addActionListener(this);
    apply.addActionListener(this);
    messageField.addMouseListener(new PopUpClass());

    // customize
    JPanel p = new JPanel();
    p.setLayout(new BoxLayout(p, BoxLayout.Y_AXIS));
    p.add(customize);
    p.add(Box.createRigidArea(new Dimension(0, 25)));
    p.add(messageField);
    p.add(Box.createRigidArea(new Dimension(0, 25)));
    p.add(apply);
    p.setBorder(BorderFactory.createEmptyBorder(25, 25, 25, 25));

    // make panel this JFrame's content pane

    this.setContentPane(p);
  }
예제 #13
0
  private void generatePlayButtonPanelContent(JPanel buttonJP) {

    buttonJP.setLayout(new BoxLayout(buttonJP, BoxLayout.X_AXIS));
    buttonJP.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));

    JButton next = new JButton("Next");
    next.setSize(75, 50);
    next.setMaximumSize(next.getSize());
    next.addMouseListener(generateNextMouseListener());
    next.setFocusable(false);

    JButton viewRanking = new JButton("Ranking");
    viewRanking.setSize(85, 50);
    viewRanking.setMaximumSize(viewRanking.getSize());
    viewRanking.addMouseListener(generateViewRankingMouseListener());
    viewRanking.setFocusable(false);

    this.scoreL = new JLabel("Score so far: ");
    this.scoreL.setSize(200, 50);
    this.scoreL.setMaximumSize(this.scoreL.getSize());

    JButton saveScore = new JButton("Save Score");
    saveScore.setSize(100, 50);
    saveScore.setMaximumSize(saveScore.getSize());
    saveScore.addMouseListener(generateSaveScoreMouseListener());
    saveScore.setFocusable(false);

    JButton end = new JButton("End");
    end.setSize(100, 50);
    end.setMaximumSize(saveScore.getSize());
    end.addMouseListener(generateEndMouseListener());
    end.setFocusable(false);

    buttonJP.add(next);
    buttonJP.add(Box.createRigidArea(new Dimension(10, 0)));
    buttonJP.add(viewRanking);
    buttonJP.add(Box.createRigidArea(new Dimension(10, 0)));
    buttonJP.add(this.scoreL);
    buttonJP.add(Box.createRigidArea(new Dimension(10, 0)));
    buttonJP.add(saveScore);
    buttonJP.add(Box.createRigidArea(new Dimension(10, 0)));
    buttonJP.add(end, BorderLayout.AFTER_LAST_LINE);
  }
예제 #14
0
  public DriverFrame() {
    super("311");

    this.setSize(this.WIDTH, this.HEIGHT);
    this.setLocationRelativeTo(null);
    this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    this.setResizable(false);
    this.getContentPane().setBackground(Color.GRAY);
    this.setLayout(new BorderLayout(10, 10));

    this.bDiv = new JPanel();
    this.tDiv = new JPanel();

    this.add(this.bDiv, BorderLayout.SOUTH);
    this.add(this.tDiv, BorderLayout.NORTH);

    this.tDiv.add(new JLabel("COSC 311 - Driver Program"));

    this.bDiv.setLayout(new BoxLayout(this.bDiv, BoxLayout.Y_AXIS));

    this.orderRadio = new JRadioButton[this.ORDER_RADIO_LABELS.length];
    this.typeRadio = new JRadioButton[this.TYPE_RADIO_LABELS.length];

    for (int i = 0; i < this.BUTTON_LABELS.length; i++) {
      if (i == this.BUTTON_LABELS.length - 1) {
        this.oRadio = new ButtonGroup();
        for (int j = 0; j < this.ORDER_RADIO_LABELS.length; j++) {
          this.orderRadio[j] = new JRadioButton(this.ORDER_RADIO_LABELS[j]);
          this.orderRadio[j].addActionListener(this);
          this.oRadio.add(this.orderRadio[j]);
          this.bDiv.add(this.orderRadio[j]);
        }
        this.orderRadio[0].setSelected(true);

        JSeparator sep = new JSeparator();
        sep.setMaximumSize(new Dimension(this.WIDTH * 2, 5));
        this.bDiv.add(sep);

        this.tRadio = new ButtonGroup();
        for (int j = 0; j < this.TYPE_RADIO_LABELS.length; j++) {
          this.typeRadio[j] = new JRadioButton(this.TYPE_RADIO_LABELS[j]);
          this.typeRadio[j].addActionListener(this);
          this.tRadio.add(this.typeRadio[j]);
          this.bDiv.add(this.typeRadio[j]);
        }
        this.typeRadio[0].setSelected(true);
      }
      JButton btn = new JButton(this.BUTTON_LABELS[i]);
      btn.addActionListener(this);
      btn.setMaximumSize(new Dimension(this.WIDTH, 25));
      this.bDiv.add(btn);

      this.myStructure = new DataStructure();
    }
  }
예제 #15
0
  /**
   * Makes a JButton with the given icon and tooltop. If the icon cannot be loaded, then the text
   * will be used instead.
   *
   * <p>Adds this RenderFame as an actionListener.
   *
   * @return a shiny new JButton
   */
  private JButton getDefaultButton(final Action a, final String tip, final ImageIcon i) {
    final JButton button = new JButton(a);
    button.setToolTipText(tip);
    button.setIcon(i);
    button.setFocusable(false);
    button.setMargin(new Insets(6, 3, 6, 3));
    button.setPreferredSize(new Dimension(32, 32));
    button.setMaximumSize(new Dimension(32, 32));
    button.setBorder(new EmptyBorder(3, 3, 3, 3));

    return button;
  }
예제 #16
0
  private JButton getJButton0() {
    if (jButton0 == null) {
      jButton0 = new JButton();
      jButton0.setMaximumSize(new Dimension(20, 18));
      // jButton0.setText("B0");
      jButton0.setForeground(Color.white);
      ImageIcon icon = new ImageIcon("/resources/icon/hide12.png");
      jButton0.setIcon(ButtonsIconsFactory.getImageIcon(ButtonsIconsFactory.Buttons.REFRESH));

      jButton0.setToolTipText("Execute");
    }
    jButton0.addMouseListener(
        new MouseAdapter() {
          public void mouseClicked(MouseEvent event) {
            String sql = "";
            String where =
                getFilterValues().createWhere(searchPanel.getFilterBeanData(), getReportType());
            String sqlW = "";
            String columnSQL = reportPanel.getColumnSQL();
            if (commonUTIL.isEmpty(columnSQL)) {
              commonUTIL.display("Execute Button", "Column are not gettting generated");
              return;
            }

            if (commonUTIL.isEmpty(where)) {
              sqlW = columnSQL;
            } else {
              sqlW = columnSQL + " and   " + where;
            }
            try {
              // commonUTIL.showAlertMessage(sql);
              data = (Vector) reportPanel.getRemoteTrade().getTradesforReport(sqlW);
              if (data != null && data.size() > 0) {

                reportPanel.loadreport(((Vector) data.get(2)));
              }

              System.out.println(data.size());
              System.out.println("PPP");
              //	jobdataPanel.setDataCreteria(data,filtersValues);
              // jobdataPanel.setJobdetails(filters);

            } catch (RemoteException e) {
              // TODO Auto-generated catch block
              e.printStackTrace();
            }
          }
        });
    return jButton0;
  }
  public FeaturePaletteScrollPane() {
    this.setBorder(BorderFactory.createTitledBorder("Feature Palette"));
    panel = new JPanel();
    panel.setLayout(new BoxLayout(panel, BoxLayout.PAGE_AXIS));
    setViewportView(panel);
    componentName = new JLabel("Component: ");
    componentName.setAlignmentX(java.awt.Component.CENTER_ALIGNMENT);
    componentName.setMinimumSize(new Dimension(200, 20));
    componentName.setMaximumSize(new Dimension(200, 20));
    cmbFeatures = new JComboBox();
    cmbFeatures.setAlignmentX(java.awt.Component.CENTER_ALIGNMENT);
    cmbFeatures.setMinimumSize(new Dimension(200, 20));
    cmbFeatures.setMaximumSize(new Dimension(200, 20));
    cmbValues = new JComboBox();
    cmbValues.setAlignmentX(java.awt.Component.CENTER_ALIGNMENT);
    cmbValues.setMinimumSize(new Dimension(200, 20));
    cmbValues.setMaximumSize(new Dimension(200, 20));
    resetButton = new JButton("Set ALL Features to Default");
    resetButton.setAlignmentX(java.awt.Component.CENTER_ALIGNMENT);
    resetButton.setMinimumSize(new Dimension(200, 20));
    resetButton.setMaximumSize(new Dimension(200, 20));
    Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
    double width = screenSize.getWidth();
    double height = screenSize.getHeight();
    int palettewidth = (int) (width * 0.4);
    int paletteheight = (int) (height * 0.25);
    this.setPreferredSize(new Dimension(palettewidth, paletteheight));
    JLabel blankLabel = new JLabel("");
    blankLabel.setMinimumSize(new Dimension(200, 20));
    blankLabel.setMaximumSize(new Dimension(200, 20));
    blankLabel.setAlignmentX(java.awt.Component.CENTER_ALIGNMENT);
    JLabel blankLabel2 = new JLabel("");
    blankLabel2.setMinimumSize(new Dimension(200, 20));
    blankLabel2.setMaximumSize(new Dimension(200, 20));
    blankLabel2.setAlignmentX(java.awt.Component.CENTER_ALIGNMENT);
    JLabel blankLabel3 = new JLabel("");
    blankLabel3.setMinimumSize(new Dimension(200, 10));
    blankLabel3.setMaximumSize(new Dimension(200, 10));
    blankLabel3.setAlignmentX(java.awt.Component.CENTER_ALIGNMENT);
    panel.add(componentName);
    panel.add(blankLabel);
    panel.add(cmbFeatures);
    panel.add(blankLabel3);
    panel.add(cmbValues);
    panel.add(blankLabel2);
    panel.add(resetButton);

    initComponents();
  }
예제 #18
0
 /**
  * This method initializes jButton3
  *
  * @return javax.swing.JButton
  */
 private JButton getSeButton() {
   if (seButton == null) {
     seButton = new JButton();
     seButton.setMaximumSize(new Dimension(64, 64));
     seButton.setPreferredSize(new Dimension(64, 64));
     seButton.setMinimumSize(new Dimension(64, 64));
     seButton.addMouseListener(
         new java.awt.event.MouseAdapter() {
           public void mouseEntered(java.awt.event.MouseEvent e) {
             rotateImages((JButton) e.getSource());
           }
         });
   }
   return seButton;
 }
예제 #19
0
  private JButton createButUp(String img, String img2, String toolTip, Dimension d) {

    JButton jB = new JButton(loadIcon(img));
    jB.setRolloverIcon(loadIcon(img2));
    jB.setToolTipText(toolTip);
    jB.setSize(d);
    jB.setPreferredSize(d);
    jB.setMaximumSize(d);
    jB.setFocusPainted(false);
    jB.setBorderPainted(false);
    jB.setContentAreaFilled(false);
    jB.addActionListener(bHUp);

    return jB;
  }
예제 #20
0
  /**
   * Makes a JButton with the given icon and tooltop. If the icon cannot be loaded, then the text
   * will be used instead.
   *
   * <p>Adds this RenderFame as an actionListener.
   *
   * @return a shiny new JButton
   */
  private JButton getDefaultActionlessButton(
      final String text, final String tip, final ImageIcon i) {
    final JButton button = new JButton();
    button.setText(text);
    button.setToolTipText(tip);
    button.setIcon(i);
    button.setFocusable(false);
    button.setMargin(new Insets(6, 3, 6, 3));
    button.setPreferredSize(new Dimension(75, 32));
    button.setMaximumSize(new Dimension(75, 32));
    button.setBorder(new EmptyBorder(3, 3, 3, 3));
    button.setFont(new Font("Tahoma", 0, 10));

    return button;
  }
예제 #21
0
 /**
  * This method initializes jButton1
  *
  * @return javax.swing.JButton
  */
 private JButton getNeButton() {
   if (neButton == null) {
     neButton = new JButton();
     neButton.setMaximumSize(new Dimension(64, 64));
     neButton.setPreferredSize(new Dimension(64, 64));
     neButton.setIcon(Configuration.getSkin().icons()[1]);
     neButton.setMinimumSize(new Dimension(64, 64));
     neButton.addMouseListener(
         new java.awt.event.MouseAdapter() {
           public void mouseEntered(java.awt.event.MouseEvent e) {
             rotateImages((JButton) e.getSource());
           }
         });
   }
   return neButton;
 }
예제 #22
0
  /**
   * Makes a JButton with the given icon and tooltop. If the icon cannot be loaded, then the text
   * will be used instead.
   *
   * <p>Adds this RenderFame as an actionListener.
   *
   * @return a shiny new JButton
   */
  private JButton getProgressButton(final Action a, final String tip, final ImageIcon i) {
    MemProgressBar mem = new MemProgressBar();
    mem.setMaximumSize(new Dimension(250, 32));
    final JButton button = new JButton(a);
    // button.add(Box.createHorizontalGlue());
    button.add(mem);
    button.setToolTipText(tip);
    button.setIcon(i);
    button.setFocusable(false);

    button.setPreferredSize(new Dimension(250, 32));
    button.setMaximumSize(new Dimension(250, 32));
    button.setBorder(new EmptyBorder(3, 3, 3, 3));

    return button;
  }
  private JComponent createSchemaBox() {
    schemaBox = new SchemaBox(this);

    JPanel panel = new JPanel();
    panel.setLayout(new BoxLayout(panel, BoxLayout.LINE_AXIS));
    panel.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, ThemeMediator.LIGHT_BORDER_COLOR));

    final String strShowOpts = I18n.tr("Show Options");
    final String strHideOpts = I18n.tr("Hide Options");

    // reusing schema box panel for more options button
    // minor optimization to keep the layout as flat as possible
    final JButton buttonOptions = new JButton(strShowOpts);
    buttonOptions.setContentAreaFilled(false);
    // buttonOptions.setBorderPainted(false);
    buttonOptions.setOpaque(false);

    Dimension dim = new Dimension(120, 30);
    buttonOptions.setMinimumSize(dim);
    buttonOptions.setMaximumSize(dim);
    buttonOptions.setPreferredSize(dim);
    buttonOptions.setSize(dim);
    // buttonOptions.setMargin(new Insets(0, 0, 0, 0));
    // buttonOptions.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0,
    // ThemeMediator.LIGHT_BORDER_COLOR));

    buttonOptions.addActionListener(
        new ActionListener() {
          @Override
          public void actionPerformed(ActionEvent e) {
            scrollPaneSearchOptions.setVisible(!scrollPaneSearchOptions.isVisible());

            buttonOptions.setText(scrollPaneSearchOptions.isVisible() ? strHideOpts : strShowOpts);
          }
        });

    JSeparator sep = new JSeparator(SwingConstants.VERTICAL);
    sep.setMaximumSize(new Dimension(2, 100));

    panel.add(schemaBox);
    panel.add(Box.createHorizontalGlue());
    panel.add(sep);
    panel.add(buttonOptions);

    return panel;
  }
예제 #24
0
  /**
   * This method initializes btnStart
   *
   * @return javax.swing.JButton
   */
  private JButton getBtnAdd() {
    if (btnAdd == null) {
      btnAdd = new JButton();
      btnAdd.setText(Constant.messages.getString("brk.add.button.add"));
      btnAdd.setMinimumSize(new java.awt.Dimension(75, 30));
      btnAdd.setPreferredSize(new java.awt.Dimension(75, 30));
      btnAdd.setMaximumSize(new java.awt.Dimension(100, 40));
      btnAdd.addActionListener(
          new java.awt.event.ActionListener() {

            public void actionPerformed(java.awt.event.ActionEvent e) {
              extension.addBreakPoint(getTxtDisplay().getText());
              extension.hideBreakAddDialog();
            }
          });
    }
    return btnAdd;
  }
예제 #25
0
  /**
   * This method initializes btnStop
   *
   * @return javax.swing.JButton
   */
  private JButton getBtnCancel() {
    if (btnCancel == null) {
      btnCancel = new JButton();
      btnCancel.setText(Constant.messages.getString("brk.add.button.cancel"));
      btnCancel.setMaximumSize(new java.awt.Dimension(100, 40));
      btnCancel.setMinimumSize(new java.awt.Dimension(70, 30));
      btnCancel.setPreferredSize(new java.awt.Dimension(70, 30));
      btnCancel.setEnabled(true);
      btnCancel.addActionListener(
          new java.awt.event.ActionListener() {

            public void actionPerformed(java.awt.event.ActionEvent e) {
              extension.hideBreakAddDialog();
            }
          });
    }
    return btnCancel;
  }
예제 #26
0
  protected void initUI() {

    GridBagLayout layout = new GridBagLayout();
    GridBagConstraints constraints = new GridBagConstraints();

    setLayout(layout);

    statusField.setFont(textFont);
    statusField.setRequestFocusEnabled(false);
    statusField.setEditable(false);

    constraints.gridx = 0;
    constraints.gridy = 0;
    constraints.fill = GridBagConstraints.HORIZONTAL;
    // constraints.weightx = 0.1;
    add(statusField, constraints);

    hostField.setFont(textFont);
    hostField.setRequestFocusEnabled(false);
    hostField.setEditable(false);
    hostField.setText("");

    constraints.gridx = 1;
    constraints.gridy = 0;
    constraints.fill = GridBagConstraints.HORIZONTAL;
    constraints.weightx = 0.5;
    add(hostField, constraints);

    cancelButton.setMaximumSize(new Dimension(20, 20));
    cancelButton.setMinimumSize(new Dimension(20, 20));
    cancelButton.setPreferredSize(new Dimension(20, 20));
    cancelButton.setEnabled(false);
    cancelButton.addActionListener(this);

    constraints.gridx = 2;
    constraints.gridy = 0;
    constraints.weightx = 0.0;
    constraints.fill = GridBagConstraints.HORIZONTAL;
    constraints.anchor = GridBagConstraints.PAGE_END;
    add(cancelButton, constraints);

    // setBorder(BorderFactory.createEtchedBorder());

  }
예제 #27
0
 /* WARNING: THIS METHOD WILL BE REGENERATED. */
 private javax.swing.JButton getOKButton() {
   if (ivjOKButton == null) {
     try {
       ivjOKButton = new javax.swing.JButton();
       ivjOKButton.setName("OKButton");
       ivjOKButton.setPreferredSize(new java.awt.Dimension(80, 25));
       ivjOKButton.setText("OK");
       ivjOKButton.setMaximumSize(new java.awt.Dimension(80, 25));
       ivjOKButton.setMinimumSize(new java.awt.Dimension(80, 25));
       // user code begin {1}
       // user code end
     } catch (java.lang.Throwable ivjExc) {
       // user code begin {2}
       // user code end
       handleException(ivjExc);
     }
   }
   return ivjOKButton;
 }
예제 #28
0
  /**
   * This method initializes btnStart
   *
   * @return javax.swing.JButton
   */
  private JButton getBtnAdd() {
    if (btnAdd == null) {
      btnAdd = new JButton();
      btnAdd.setText(Constant.messages.getString("history.managetags.button.add"));
      btnAdd.setMinimumSize(new java.awt.Dimension(75, 30));
      btnAdd.setPreferredSize(new java.awt.Dimension(75, 30));
      btnAdd.setMaximumSize(new java.awt.Dimension(100, 40));
      btnAdd.addActionListener(
          new java.awt.event.ActionListener() {

            @Override
            public void actionPerformed(java.awt.event.ActionEvent e) {
              addTag(getTxtTagAdd().getSelectedItem().toString());
              getTxtTagAdd().setSelectedIndex(0);
            }
          });
    }
    return btnAdd;
  }
예제 #29
0
  /**
   * This method initializes btnDelete
   *
   * @return javax.swing.JButton
   */
  private JButton getBtnDelete() {
    if (btnDelete == null) {
      btnDelete = new JButton();
      btnDelete.setText(Constant.messages.getString("history.managetags.button.delete"));
      btnDelete.setMinimumSize(new java.awt.Dimension(75, 30));
      btnDelete.setPreferredSize(new java.awt.Dimension(75, 30));
      btnDelete.setMaximumSize(new java.awt.Dimension(100, 40));
      btnDelete.setEnabled(true);
      btnDelete.addActionListener(
          new java.awt.event.ActionListener() {

            @Override
            public void actionPerformed(java.awt.event.ActionEvent e) {
              deleteTags(tagList.getSelectedValuesList());
            }
          });
    }
    return btnDelete;
  }
예제 #30
0
  private JButton getJButton4() {
    if (jButton4 == null) {
      jButton4 = new JButton();
      jButton4.setMaximumSize(new Dimension(20, 18));
      // jButton0.setText("B0");

      jButton4.setIcon(ButtonsIconsFactory.getImageIcon(ButtonsIconsFactory.Buttons.CLEARALL));

      jButton4.setToolTipText("Clear All");
      jButton4.addActionListener(
          new ActionListener() {
            public void actionPerformed(ActionEvent arg0) {
              searchPanel.clearllCriteriaModel();
              searchPanel.getFilterBeanData().clear();
              job = null;
            }
          });
    }
    return jButton4;
  }