Example #1
1
  protected JPanel createShowResultPanel() {
    JPanel panel = new JPanel(new GridBagLayout());

    panel.setBorder(
        BorderFactory.createTitledBorder(
            BorderFactory.createEtchedBorder(), resources.getString("ShowResultPanel.title")));

    ExtendedGridBagConstraints gbc = new ExtendedGridBagConstraints();
    gbc.insets = new Insets(2, 2, 2, 2);

    gbc.anchor = ExtendedGridBagConstraints.WEST;
    gbc.fill = ExtendedGridBagConstraints.NONE;
    gbc.setWeight(0, 0);

    ButtonGroup grp = new ButtonGroup();

    highlightButton = buttonFactory.createJRadioButton("Highlight");
    highlightButton.setSelected(true);
    grp.add(highlightButton);
    gbc.setGridBounds(0, 0, 1, 1);
    panel.add(highlightButton, gbc);

    highlightCenterButton = buttonFactory.createJRadioButton("HighlightAndCenter");
    grp.add(highlightCenterButton);
    gbc.setGridBounds(0, 1, 1, 1);
    panel.add(highlightCenterButton, gbc);

    highlightCenterZoomButton = buttonFactory.createJRadioButton("HighlightCenterAndZoom");
    grp.add(highlightCenterZoomButton);
    gbc.setGridBounds(0, 2, 1, 1);
    panel.add(highlightCenterZoomButton, gbc);

    return panel;
  }
Example #2
0
  private MainPanel() {
    super(new GridLayout(3, 1, 5, 5));
    final JTree tree = new JTree();
    final JCheckBox c = new JCheckBox("CheckBox", true);
    c.addActionListener(
        new ActionListener() {
          @Override
          public void actionPerformed(ActionEvent e) {
            tree.setEnabled(c.isSelected());
          }
        });
    c.setFocusPainted(false);
    JScrollPane l1 = new JScrollPane(tree);
    l1.setBorder(new ComponentTitledBorder(c, l1, BorderFactory.createEtchedBorder()));

    JLabel icon = new JLabel(new ImageIcon(getClass().getResource("16x16.png")));
    JLabel l2 = new JLabel("<html>aaaaaaaaaaaaaaaa<br>bbbbbbbbbbbbbbbbb");
    l2.setBorder(new ComponentTitledBorder(icon, l2, BorderFactory.createEtchedBorder()));

    JButton b = new JButton("Button");
    b.setFocusPainted(false);
    JLabel l3 = new JLabel("ccccccccccccccc");
    l3.setBorder(new ComponentTitledBorder(b, l3, BorderFactory.createEtchedBorder()));

    add(l1);
    add(l2);
    add(l3);
    setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
    setPreferredSize(new Dimension(320, 240));
  }
Example #3
0
  private void buildFields() {
    JLabel lbFaculty = new JLabel("Факультет:");
    lbFaculty.setHorizontalAlignment(SwingConstants.RIGHT);
    lbFaculty.setBounds(new Rectangle(PAD, 0 * H_B + PAD, W_L, H_B));
    add(lbFaculty);
    txtFaculty.setBounds(new Rectangle(W_L + 2 * PAD, 0 * H_B + PAD, W_T, H_B));
    txtFaculty.setBorder(BorderFactory.createEtchedBorder());
    add(txtFaculty);

    JLabel lbNOG = new JLabel("Группа:");
    lbNOG.setHorizontalAlignment(SwingConstants.RIGHT);
    lbNOG.setBounds(new Rectangle(PAD, 1 * H_B + PAD, W_L, H_B));
    add(lbNOG);
    txtNOG.setBounds(new Rectangle(W_L + 2 * PAD, 1 * H_B + PAD, W_T, H_B));
    txtNOG.setBorder(BorderFactory.createEtchedBorder());
    add(txtNOG);

    JLabel lbName = new JLabel("Имя:");
    lbName.setHorizontalAlignment(SwingConstants.RIGHT);
    lbName.setBounds(new Rectangle(PAD, 2 * H_B + PAD, W_L, H_B));
    add(lbName);
    txtName.setBounds(new Rectangle(W_L + 2 * PAD, 2 * H_B + PAD, W_T, H_B));
    txtName.setBorder(BorderFactory.createEtchedBorder());
    add(txtName);

    JLabel lbDOE = new JLabel("Дата зачисления:");
    lbDOE.setHorizontalAlignment(SwingConstants.RIGHT);
    lbDOE.setBounds(new Rectangle(PAD, 3 * H_B + PAD, W_L, H_B));
    add(lbDOE);
    txtDOE.setBounds(new Rectangle(W_L + 2 * PAD, 3 * H_B + PAD, W_T, H_B));
    txtDOE.setBorder(BorderFactory.createEtchedBorder());
    add(txtDOE);
  }
    public SparqlScapeContainer(SparqlScapePlugin myPlugin) {
      this.plugin = myPlugin;
      this.setLayout(new GridBagLayout());
      GridBagConstraints c = new GridBagConstraints();

      c.anchor = GridBagConstraints.NORTH;

      JPanel endpointPanel = new JPanel();
      endpointPanel.setLayout(new GridBagLayout());
      endpointPanel.add(new Label("SPARQL Endpoint:"), c);
      c.gridx = 0;
      c.gridy = 1;
      endpointPanel.add(plugin.configureMenu.curServer, c);
      endpointPanel.setBorder(BorderFactory.createEtchedBorder(EtchedBorder.LOWERED));
      c.gridy = 0;
      this.add(endpointPanel, c);

      JPanel urlPanel = new JPanel();
      urlPanel.add(new JLabel("Node Fetch:"), c);
      c.gridx = 0;
      c.gridy = 1;
      urlPanel.setLayout(new GridBagLayout());
      urlText = new TextField(30);
      urlPanel.add(urlText, c);
      Button fetchButton = new Button("Fetch");
      fetchButton.addActionListener(this);
      c.gridx = 0;
      c.gridy = 2;
      urlPanel.add(fetchButton, c);
      urlPanel.setBorder(BorderFactory.createEtchedBorder(EtchedBorder.LOWERED));
      c.gridy = 1;
      this.add(urlPanel, c);

      c.gridx = 0;
      c.gridy = 3;
      Button searchButton = new Button("Find Nodes");
      searchButton.addActionListener(this);
      this.add(searchButton, c);

      JPanel fetchPanel = new JPanel();
      Button fetchSelectedButton = new Button("Fetch Selected");
      fetchSelectedButton.addActionListener(this);
      fetchPanel.add(fetchSelectedButton);
      filterCheckbox = new Checkbox("Filter", true);
      fetchPanel.add(filterCheckbox);

      c.gridx = 0;
      c.gridy = 4;
      this.add(fetchPanel, c);

      c.gridy = 5;
      Button editNamespaces = new Button("Edit Namespaces");
      editNamespaces.addActionListener(this);
      this.add(editNamespaces, c);

      this.setVisible(true);

      iSparql = new SparqlInterface(prefs.getEndpoint());
    }
Example #5
0
  loginframe() {
    Container c = getContentPane();
    c.setLayout(null);
    Color co1 = new Color(252, 251, 251);
    Color co2 = new Color(153, 153, 153);
    Color co3 = new Color(0, 0, 0);
    Font fo1 = new Font("Curlz MT", Font.BOLD, 35);
    Font fo2 = new Font("Tahoma", Font.BOLD, 14);
    Font fo3 = new Font("Tahoma", Font.PLAIN, 12);

    l1 = new JLabel("LOGIN");
    l1.setFont(fo1);
    c.add(l1);
    l1.setBounds(130, 30, 200, 30);
    l1.setForeground(co1);

    l2 = new JLabel("Username");
    c.add(l2);
    l2.setBounds(130, 100, 100, 30);
    l2.setForeground(co1);
    l2.setFont(fo2);

    l3 = new JLabel("Password");
    c.add(l3);
    l3.setBounds(130, 150, 100, 30);
    l3.setForeground(co1);
    l3.setFont(fo2);

    t1 = new JTextField();
    t1.setBounds(250, 100, 120, 25);
    c.add(t1);
    t1.setBackground(co2);
    t1.setBorder(javax.swing.BorderFactory.createEtchedBorder());
    t1.setForeground(co3);
    t1.setFont(fo3);

    p1 = new JPasswordField();
    p1.setBounds(250, 150, 120, 25);
    c.add(p1);
    p1.setBackground(co2);
    p1.setBorder(javax.swing.BorderFactory.createEtchedBorder());

    b1 = new JButton("Login");
    b1.setBounds(140, 220, 70, 30);
    b1.addActionListener(this);
    c.add(b1);

    b2 = new JButton("Exit");
    b2.setBounds(270, 220, 70, 30);
    b2.addActionListener(this);
    c.add(b2);

    l4 = new JLabel("");
    c.add(l4);
    l4.setBounds(0, 0, 464, 409);
    l4.setIcon(new javax.swing.ImageIcon(getClass().getResource("/loginpackage/locked2_1.jpg")));
  }
Example #6
0
  @Override
  public JComponent layoutDialogContent() {
    final JPanel contentpane = new JPanel(new MigLayout("ins 0,wrap 2", "[fill,grow]"));
    messageArea = new JTextPane();
    messageArea.setBorder(null);
    messageArea.setBackground(null);
    messageArea.setOpaque(false);
    messageArea.setText(message);
    messageArea.setEditable(false);
    messageArea.putClientProperty("Synthetica.opaque", Boolean.FALSE);

    contentpane.add("span 2", messageArea);
    contentpane.add(new JLabel(_AWU.T.PASSWORDDIALOG_PASSWORDCHANGE_OLDPASSWORD()));
    if (BinaryLogic.containsAll(flagMask, Dialog.STYLE_LARGE)) {
      input1 = new JPasswordField();
      input1.addKeyListener(this);
      input1.addMouseListener(this);
      contentpane.add(new JScrollPane(input1), "height 20:60:n,pushy,growy,w 250");
    } else {
      input1 = new JPasswordField();
      input1.setBorder(BorderFactory.createEtchedBorder());
      input1.addKeyListener(this);
      input1.addMouseListener(this);
      contentpane.add(input1, "pushy,growy,w 250");
    }
    contentpane.add(new JLabel(_AWU.T.PASSWORDDIALOG_PASSWORDCHANGE_NEWPASSWORD()));
    if (BinaryLogic.containsAll(flagMask, Dialog.STYLE_LARGE)) {
      input2 = new JPasswordField();
      input2.addKeyListener(this);
      input2.addMouseListener(this);
      contentpane.add(new JScrollPane(input2), "height 20:60:n,pushy,growy,w 250");
    } else {
      input2 = new JPasswordField();
      input2.setBorder(BorderFactory.createEtchedBorder());
      input2.addKeyListener(this);
      input2.addMouseListener(this);
      contentpane.add(input2, "pushy,growy,w 250");
    }
    contentpane.add(new JLabel(_AWU.T.PASSWORDDIALOG_PASSWORDCHANGE_NEWPASSWORD_REPEAT()));
    if (BinaryLogic.containsAll(flagMask, Dialog.STYLE_LARGE)) {
      input3 = new JPasswordField();
      input3.addKeyListener(this);
      input3.addMouseListener(this);
      contentpane.add(new JScrollPane(input3), "height 20:60:n,pushy,growy,w 250");
    } else {
      input3 = new JPasswordField();
      input3.setBorder(BorderFactory.createEtchedBorder());
      input3.addKeyListener(this);
      input3.addMouseListener(this);
      contentpane.add(input3, "pushy,growy,w 250");
    }

    return contentpane;
  }
 OperPanel() {
   setLayout(null);
   add(tabPanel);
   Border border_1 = BorderFactory.createEtchedBorder(1);
   tabPanel.setBorder(border_1);
   tabPanel.setBounds(5, 5, 630, 630);
   tabPanel.setLayout(new BorderLayout());
   add(modiPanel);
   Border border_2 = BorderFactory.createEtchedBorder(1);
   modiPanel.setBorder(border_2);
   modiPanel.setBounds(640, 5, 310, 630);
   modiPanel.setLayout(null);
 }
public interface Constantes {

  /** Cor de background do frame interno. */
  // public static final Color COR_INTERNO_BACKGROUND = new Color(191, 203, 235);
  static final Color COR_PAINEL_BACKGROUND = new Color(135, 206, 235);
  /** A cor que será aplicada no Backgroud dos campos. */
  static final Color COR_CAMPO_BACKGROUD = new Color(255, 250, 220);
  /** A cor que será usada para destacar alguns componentes. */
  static final Color COR_DE_DESTAQUE_CAMPOS = Color.RED;
  /** A cor padr�o das bordas dos componentes dos frames. */
  static final Color COR_PADRAO_BORDA = Color.BLACK;
  /** Constante que cria a forma de uma borda funda nos componente. */
  static final Border BORDA_FUNDA =
      BorderFactory.createEtchedBorder(EtchedBorder.RAISED, null, new Color(0, 0, 0));
  /** Constante que cria a forma de uma borda gravada no componente. */
  static final Border BORDA_GRAVADA = BorderFactory.createEtchedBorder();
  /** Constante que padroniza a altura do campos de texto, caixas de combinação, rótulos, etc. */
  static final int ALTURA_CAMPO = 25;
  /**
   * Constante que padroniza a largura dos objetos <code>JTextField</code> e <code>
   * JFormatedTextField</code>.
   */
  static final int LARGURA_CAMPO = 120;
  /** Constante que padroniza a largura dos objetos <code>JLabel</code>. */
  static final int LARGURA_ROTULO = 70;
  /** Nome da fonte que será utilizada no software. */
  static final String NOME_FONTE = "Comic Sans";
  /** Constante que padroniza a fonte dos objetos <code>JTextField</code>. */
  static final Font FONTE_CAMPO_TEXTO = new Font(NOME_FONTE, Font.PLAIN, 14);
  /** Constante que padroniza a fonte aplicadas nos objetos <code>JLabel</code>. */
  static final Font FONTE_ROTULO = new Font(NOME_FONTE, Font.BOLD, 18);
  /** Cursor de mão (Hand Cursor). */
  static final Cursor HAND_CURSOR = new Cursor(Cursor.HAND_CURSOR);
  /** Caminho do icone Voltar. */
  static final String ICONE_VOLTAR = "src/resources/voltar.png";
  /** Caminho do icone Caixa. */
  static final String ICONE_CAIXA = "src/resources/caixa.png";
  /** Caminho do icone Incluir. */
  static final String ICONE_INCLUIR = "src/resources/incluir.png";
  /** Caminho do icone Pesquisar. */
  static final String ICONE_PESQUISAR = "src/resources/pesquisar.png";
  /** Caminho do icone Recarregar. */
  static final String ICONE_RECARREGAR = "src/resources/recarregar.png";
  /** Caminho do icone Salvar. */
  static final String ICONE_SALVAR = "src/resources/salvar.png";
  /** Caminho do icone Finalizar. */
  static final String ICONE_FINALIZAR = "src/resources/finalizar.png";
}
Example #9
0
  public Plot2Da() {
    check_ = new JCheckBox("Hold on");
    plot_ = new Plot2D();

    setLayout(new GridBagLayout());
    GridBagConstraints c = new GridBagConstraints();
    c.insets = new Insets(2, 2, 2, 2);
    c.weightx = 1.0;
    c.weighty = 1.0;

    c.gridheight = 1;
    c.gridwidth = 1;
    c.gridx = 0;
    c.gridy = 0;
    add(check_, c);

    c.gridwidth = 1;
    c.gridheight = 1;
    c.gridx = 0;
    c.gridy = 1;
    c.fill = GridBagConstraints.REMAINDER;
    c.ipadx = plot_.getSize().width + 100;
    c.ipady = plot_.getSize().height + 100;
    plot_.setBackground(Color.WHITE);

    add(plot_, c);

    setBorder(BorderFactory.createEtchedBorder());
  }
Example #10
0
  private JPanel createCentrePanel(YDataStateException exception) {
    JPanel centrePanel = new JPanel(new GridLayout(1, 2));

    JPanel msgPanel = new JPanel(new BorderLayout());
    msgPanel.setBackground(YAdminGUI._apiColour);
    msgPanel.setBorder(
        BorderFactory.createCompoundBorder(
            BorderFactory.createTitledBorder(
                BorderFactory.createEtchedBorder(), "Schema for completing task"),
            BorderFactory.createEmptyBorder(10, 10, 10, 10)));
    JTextPane msgTextPane = new JTextPane();
    msgTextPane.setContentType("text/plain");
    msgTextPane.setFont(new Font("courier", Font.PLAIN, 12));
    msgTextPane.setForeground(Color.RED);

    msgTextPane.setText(exception.getMessage());
    msgTextPane.setEditable(false);
    msgTextPane.setBackground(Color.LIGHT_GRAY);
    JPanel noWrapPanel = new JPanel();
    noWrapPanel.setLayout(new BorderLayout());
    noWrapPanel.add(msgTextPane);
    msgPanel.add(new JScrollPane(noWrapPanel));

    centrePanel.add(msgPanel, BorderLayout.NORTH);
    return centrePanel;
  }
Example #11
0
  public void initializeGUIComponents() {

    // Setup Data Panel
    editButton = new JButton("Edit");
    editButton.addActionListener(buttonController);
    JPanel buttonPanel = new JPanel();
    FlowLayout flowLayout = (FlowLayout) buttonPanel.getLayout();
    flowLayout.setAlignment(FlowLayout.RIGHT);
    buttonPanel.add(editButton);
    buttonPanel.add(Box.createHorizontalStrut(10));

    // Setup the Main Panel.
    setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), "Skills"));
    setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));

    // Setup TextField
    scrollPane = new JScrollPane();
    taSkills = new JTextArea();
    taSkills.setLineWrap(true);
    taSkills.setWrapStyleWord(true);
    taSkills.setEditable(false);
    scrollPane.setViewportView(taSkills);

    add(scrollPane);
    add(buttonPanel);
  }
  // <editor-fold defaultstate="collapsed" desc=" Generated Code
  // <editor-fold defaultstate="collapsed" desc=" Generated Code
  // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
  private void initComponents() {

    propertySheetPanel = new com.l2fprod.common.propertysheet.PropertySheetPanel();

    setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
    setTitle("Properties");
    setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
    setModal(true);
    addWindowListener(
        new java.awt.event.WindowAdapter() {
          public void windowClosed(java.awt.event.WindowEvent evt) {
            formWindowClosed(evt);
          }
        });

    propertySheetPanel.setBorder(javax.swing.BorderFactory.createEtchedBorder());
    propertySheetPanel.setAutoscrolls(true);
    propertySheetPanel.setDescriptionVisible(true);
    propertySheetPanel.setToolBarVisible(true);

    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
    getContentPane().setLayout(layout);
    layout.setHorizontalGroup(
        layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(
                propertySheetPanel, javax.swing.GroupLayout.DEFAULT_SIZE, 273, Short.MAX_VALUE));
    layout.setVerticalGroup(
        layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(
                propertySheetPanel, javax.swing.GroupLayout.DEFAULT_SIZE, 283, Short.MAX_VALUE));

    pack();
  } // </editor-fold>//GEN-END:initComponents
Example #13
0
    public PropertyPanel(String title, Properties properties) {
      super();
      setBorder(new TitledBorder(BorderFactory.createEtchedBorder(), title));
      setLayout(new GridLayout(1, 1, 10, 10));
      JTextArea area = new JTextArea(Math.min(properties.size(), 20), 40);
      area.setEditable(false);
      area.setOpaque(false);
      area.setTabSize(16);

      Iterator iter = properties.keySet().iterator();
      if (iter.hasNext()) { // first line
        String key = (String) iter.next();
        area.append(key);
        area.append("\t");
        area.append(properties.getProperty(key));
      }
      while (iter.hasNext()) { // remaining lines
        area.append("\n");
        String key = (String) iter.next();
        area.append(key);
        area.append("\t");
        area.append(properties.getProperty(key));
      }
      add(new JScrollPane(area));
    }
Example #14
0
  private void initComponents(String title) {
    getContentPane().setLayout(new BorderLayout());

    JPanel mainPane = new JPanel(new BorderLayout());
    mainPane.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));

    JLabel text = new JLabel(title, JLabel.CENTER);
    text.setFont(FONT);
    text.setOpaque(true);
    text.setBackground(Color.orange);
    //		text.setFont(UIManager.getFont("Label.font"));
    mainPane.add(text, "North");

    JPanel panel = new JPanel(new GridLayout(1, 6));
    for (int i = 1; i <= 6; i++) {
      Die die = template.getCopy();
      die.setFace(i);
      FaceButton button = new FaceButton(die, i);
      panel.add(button);
    }
    mainPane.add(panel, "South");

    if (icon != null) {
      JLabel iconLabel = new JLabel(icon);
      iconLabel.setBorder(BorderFactory.createEtchedBorder());
      mainPane.add(iconLabel, "Center");
    }

    getContentPane().add(mainPane, "Center");
    setResizable(false);
    setDefaultCloseOperation(JDialog.DO_NOTHING_ON_CLOSE);
    pack();
  }
 /*
  * (non-Javadoc)
  *
  * @see org.deegree.igeo.views.IView#init(org.deegree.client.presenter.state.ComponentStateAdapter,
  * org.deegree.client.configuration.ViewForm)
  */
 public void init(ViewFormType viewForm) throws Exception {
   setResizable(
       ((InnerFrameViewFormType) viewForm.get_AbstractViewForm().getValue()).isResizeable());
   setMaximizable(true);
   setIconifiable(true);
   Border outsideBorder = BorderFactory.createEtchedBorder(EtchedBorder.RAISED);
   Border insideBorder = BorderFactory.createLineBorder(new Color(197, 197, 220), 3);
   setBorder(BorderFactory.createCompoundBorder(outsideBorder, insideBorder));
   // TODO
   // each internal frame should have its own icon
   setFrameIcon(IconRegistry.getIcon("layers.png"));
   ComponentPosition compPosAdapter = this.owner.getComponentPositionAdapter();
   if (compPosAdapter.hasWindow()) {
     setSize(compPosAdapter.getWindowWidth(), compPosAdapter.getWindowHeight());
     setLocation(compPosAdapter.getWindowLeft(), compPosAdapter.getWindowTop());
   }
   setTitle(this.owner.getName());
   if (getParent() == null) {
     // parent is null view has not been yet added to its parent. This is the case if a
     // module's view is 'closed' when loading a project
     Container con = (Container) owner.getGUIContainer();
     if (con != null) {
       con.add(this);
     }
   }
 }
Example #16
0
  private JPanel createRadioButtonPanel() {

    JPanel buttonPanel = new JPanel();
    buttonPanel.setLayout(new GridLayout(1, 3));

    middleButton = new JRadioButton("Middle Page");
    middleButton.setHorizontalAlignment(AbstractButton.CENTER);
    middleButton.setActionCommand(Page.MIDDLE);
    middleButton.setEnabled(false);

    endButton = new JRadioButton("End Page");
    endButton.setHorizontalAlignment(AbstractButton.CENTER);
    endButton.setActionCommand(Page.END);
    endButton.setEnabled(false);

    initButton = new JRadioButton("Start Page");
    initButton.setHorizontalAlignment(AbstractButton.CENTER);
    initButton.setActionCommand(Page.START);
    initButton.setEnabled(false);

    ButtonGroup group = new ButtonGroup();
    group.add(initButton);
    group.add(middleButton);
    group.add(endButton);

    buttonPanel.add(initButton);
    buttonPanel.add(middleButton);
    buttonPanel.add(endButton);
    buttonPanel.setBorder(BorderFactory.createEtchedBorder());

    return buttonPanel;
  }
  public UnitListInternalFrame(String Title, Vector<Unit> units, UnitChangeListener ucl) {
    super(Title, true, true, true, true);

    m_UnitListPanel = new UnitListPanel(units);
    m_UnitListPanel.addUnitChangeListener(ucl);

    getContentPane().setLayout(new BorderLayout());

    // m_UnitListPanel.setFocusable(false);
    getContentPane().add(m_UnitListPanel, BorderLayout.CENTER);

    m_ButtonPanel.setBorder(BorderFactory.createEtchedBorder());
    m_ButtonPanel.setLayout(new BoxLayout(m_ButtonPanel, BoxLayout.X_AXIS));

    m_NewButton.setAlignmentY(Component.CENTER_ALIGNMENT);
    m_NewButton.setActionCommand("New");
    m_NewButton.addActionListener(this);

    m_RemoveButton.setAlignmentY(Component.CENTER_ALIGNMENT);
    m_RemoveButton.setActionCommand("Remove");
    m_RemoveButton.addActionListener(this);

    m_EditButton.setAlignmentY(Component.CENTER_ALIGNMENT);
    m_EditButton.setActionCommand("Edit");
    m_EditButton.addActionListener(this);

    m_ButtonPanel.add(m_NewButton);
    m_ButtonPanel.add(m_EditButton);
    m_ButtonPanel.add(Box.createHorizontalBox());
    m_ButtonPanel.add(m_RemoveButton);
    m_ButtonPanel.add(Box.createHorizontalGlue());

    getContentPane().add(m_ButtonPanel, BorderLayout.SOUTH);
  }
Example #18
0
    public OKPanel() {
      setLayout(new FlowLayout(FlowLayout.RIGHT));

      setBorder(BorderFactory.createEtchedBorder());
      JButton saveButton = new JButton(StringConstants.BUTTON_SAVE);

      saveButton.addActionListener(
          new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
              saveSettings();
              thisFrame.setVisible(false);
            }
          });

      JButton cancelButton = new JButton(StringConstants.BUTTON_CANCEL);
      cancelButton.addActionListener(
          new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent event) {
              thisFrame.setVisible(false);
              // System.exit(0);
            }
          });
      add(saveButton);
      add(cancelButton);
    }
Example #19
0
 public EbEbaySiteEditPanel(
     EbEbaySiteDialog parent,
     ListCursor listCursor,
     String tabStatus,
     EbEbaySiteListPanel listPanel) {
   // TODO Auto-generated constructor stub
   super(EbSite.class, BillElementMeta.getBillElementMetaWithoutNd("EB_SITE"));
   this.listCursor = listCursor;
   this.tabStatus = tabStatus;
   this.listPanel = listPanel;
   this.parent = parent;
   this.workPanel.setBorder(
       BorderFactory.createTitledBorder(
           BorderFactory.createEtchedBorder(),
           LangTransMeta.translate(listPanel.getCompoId()),
           TitledBorder.CENTER,
           TitledBorder.TOP,
           new Font("宋体", Font.BOLD, 15),
           Color.BLUE));
   this.colCount = 2;
   billElementMeta = BillElementMeta.getBillElementMetaWithoutNd(listPanel.getCompoId());
   init();
   requestMeta.setCompoId(listPanel.getCompoId());
   refreshData();
   setButtonStatus();
   updateFieldEditorsEditable();
 }
  /** Inits the GUI. */
  private void init() {
    setLayout(new BorderLayout(0, 10));
    setBorder(makeBorder());

    add(makeTitlePanel(), BorderLayout.NORTH);

    JPanel mainPanel = new JPanel(new BorderLayout());

    // USER_INPUT
    VerticalPanel assertionPanel = new VerticalPanel();
    assertionPanel.setBorder(
        BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), "XML Schema"));

    // doctype
    HorizontalPanel xmlSchemaPanel = new HorizontalPanel();

    xmlSchemaPanel.add(
        new JLabel(JMeterUtils.getResString("xmlschema_assertion_label"))); // $NON-NLS-1$

    xmlSchema = new JTextField(26);
    xmlSchemaPanel.add(xmlSchema);

    assertionPanel.add(xmlSchemaPanel);

    mainPanel.add(assertionPanel, BorderLayout.NORTH);
    add(mainPanel, BorderLayout.CENTER);
  }
Example #21
0
  public PreviewPopup(JScrollPane scrollPane, boolean doCloseAfterClick) {
    this.setBorder(BorderFactory.createEtchedBorder());

    _doCloseAfterClick = doCloseAfterClick;

    _scrollPane = scrollPane;
    _viewPort = _scrollPane.getViewport();

    _zoomWindow = new JLabel();
    _cursorLabel = createCursor();

    _layeredPane = new JLayeredPane();

    _layeredPane.add(_zoomWindow, new Integer(0));
    _layeredPane.add(_cursorLabel, new Integer(1));

    // Creates a blank transparent cursor to be used as the cursor of
    // the popup menu.
    BufferedImage bim = new BufferedImage(1, 1, BufferedImage.TYPE_4BYTE_ABGR);
    setCursor(getToolkit().createCustomCursor(bim, (new Point(0, 0)), "PreviewCursor"));

    this.add(_layeredPane);

    // Adds the mouse input listeners to the _layeredPane to scroll the
    // viewport and to move the fake cursor (_cursorLabel).
    _layeredPane.addMouseListener(this);
    _layeredPane.addMouseMotionListener(this);
  }
Example #22
0
  /** 查询 */
  private void search() {
    // 调用查询窗口
    Function function = new Function();
    Search search = new Search(this, staffInfo);
    function.setFunctionDialog(search);
    function.create();
    if (search.isUpdate()) {
      int searched = search.getSearched();

      switch (searched) {
        case 0:
          DMManage();
          break;
        case 1:
          break;
        case 3:
          break;
        case 4:
          break;
        case 5:
          break;
      }
      content = search.getResultContent();
      header = search.getResultHeader();
      displayPanel.setBorder(
          BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), "查询结果"));
      setTable(content, header);
    }
  }
  private Component panelCentro() {
    JPanel panel = new JPanel(new GridLayout(2, 2, 20, 10));
    JLabel lValor;
    JLabel lValor1;

    JTextField text = new JTextField();
    JPasswordField pass = new JPasswordField();

    panel.setBorder(
        BorderFactory.createTitledBorder(
            BorderFactory.createEtchedBorder(0, Color.RED, Color.red), "Identificacion"));

    lValor = new JLabel();
    lValor.setFont(new Font("Verdana", Font.CENTER_BASELINE, 12));
    lValor.setForeground(Color.black);
    lValor.setHorizontalAlignment(lValor.LEFT);

    lValor1 = new JLabel();
    lValor1.setFont(new Font("Verdana", Font.CENTER_BASELINE, 12));
    lValor1.setForeground(Color.black);
    lValor1.setHorizontalAlignment(lValor.LEFT);

    lValor.setText("Usuario:");
    panel.add(lValor);

    lValor.setText("Contraseña:");
    panel.add(lValor1);

    text = new JTextField();

    pass = new JPasswordField();

    return panel;
  }
  /** Constructs a new Sceen with given height & width (in words) and amount of bits per word. */
  public ScreenComponent() {
    setOpaque(true);
    setBackground(Color.white);
    setBorder(BorderFactory.createEtchedBorder());
    Insets borderInsets = getBorder().getBorderInsets(this);
    int borderWidth = borderInsets.left + borderInsets.right;
    int borderHeight = borderInsets.top + borderInsets.bottom;
    setPreferredSize(
        new Dimension(
            Definitions.SCREEN_WIDTH + borderWidth, Definitions.SCREEN_HEIGHT + borderHeight));
    setSize(Definitions.SCREEN_WIDTH + borderWidth, Definitions.SCREEN_HEIGHT + borderHeight);

    data = new short[Definitions.SCREEN_SIZE];
    x = new int[Definitions.SCREEN_SIZE];
    y = new int[Definitions.SCREEN_SIZE];
    x[0] = borderInsets.left;
    y[0] = borderInsets.top;

    // updates pixels indice
    for (int i = 1; i < Definitions.SCREEN_SIZE; i++) {
      x[i] = x[i - 1] + Definitions.BITS_PER_WORD;
      y[i] = y[i - 1];
      if (x[i] == Definitions.SCREEN_WIDTH + borderInsets.left) {
        x[i] = borderInsets.left;
        y[i]++;
      }
    }

    timer = new Timer(STATIC_CLOCK_INTERVALS, this);
    timer.start();
  }
  /**
   * Create pane for legend settings
   *
   * @return Legend pane
   */
  private JPanel createLegendPane() {
    JPanel legendPanel = new JPanel();
    legendPanel.setLayout(new FlowLayout(FlowLayout.LEFT, 0, 0));
    legendPanel.setBorder(
        BorderFactory.createTitledBorder(
            BorderFactory.createEtchedBorder(),
            JMeterUtils.getResString("aggregate_graph_legend"))); // $NON-NLS-1$

    legendPanel.add(
        GuiUtils.createLabelCombo(
            JMeterUtils.getResString("aggregate_graph_legend_placement"), // $NON-NLS-1$
            legendPlacementList));
    legendPlacementList.setSelectedItem(
        JMeterUtils.getResString("aggregate_graph_legend.placement.bottom")); // default: bottom
    legendPanel.add(
        GuiUtils.createLabelCombo(
            JMeterUtils.getResString("aggregate_graph_font"), // $NON-NLS-1$
            fontNameList));
    fontNameList.setSelectedIndex(0); // default: sans serif
    legendPanel.add(
        GuiUtils.createLabelCombo(
            JMeterUtils.getResString("aggregate_graph_size"), // $NON-NLS-1$
            fontSizeList));
    fontSizeList.setSelectedItem(StatGraphProperties.fontSize[2]); // default: 10
    legendPanel.add(
        GuiUtils.createLabelCombo(
            JMeterUtils.getResString("aggregate_graph_style"), // $NON-NLS-1$
            fontStyleList));
    fontStyleList.setSelectedItem(JMeterUtils.getResString("fontstyle.normal")); // default: normal

    return legendPanel;
  }
Example #26
0
  public void onWho(ActionEvent actionEvent) {
    StandardDialog dlg = new StandardDialog();
    dlg.setTitle("Your name and address");

    String strName = prefs.get(NAME, server.ip + ":" + server.port);

    JTextField name = new JTextField(strName),
        ip = new JTextField(server.ip),
        port = new JTextField(server.port + "");
    ip.setEditable(false);
    port.setEditable(false);

    LabelledItemPanel myContentPane = new LabelledItemPanel();
    myContentPane.setBorder(BorderFactory.createEtchedBorder());
    myContentPane.addItem("Your name", name);
    myContentPane.addItem("", new JLabel("Tell your buddy the follows:"));
    myContentPane.addItem("Your IP", ip);
    myContentPane.addItem("Your port", port);

    dlg.setContentPane(myContentPane);
    dlg.setSize(300, 300);
    GUIUtils.centerWithinScreen(dlg);
    dlg.setVisible(true);

    if (!dlg.hasUserCancelled()) {
      prefs.put(NAME, name.getText());
      server.myName = name.getText();
    }
  }
  public CollapsiblePanel(String aTitle, Component aComponent, boolean aStartCollapsed) {
    super(new BorderLayout());
    content = aComponent;
    setBorder(
        BorderFactory.createCompoundBorder(
            BorderFactory.createEmptyBorder(5, 5, 5, 5), BorderFactory.createEtchedBorder()));

    title.setHorizontalAlignment(SwingConstants.CENTER);
    title.setFont(title.getFont().deriveFont(18.0f));
    add(title, BorderLayout.NORTH);
    add(content, BorderLayout.CENTER);

    title.addMouseListener(
        new MouseAdapter() {
          @Override
          public void mouseClicked(MouseEvent aE) {
            if (aE.getClickCount() == 1) {
              content.setVisible(!content.isVisible());
            }
          }
        });

    if (aStartCollapsed) content.setVisible(false);

    setTitle(aTitle);
  }
  private void montaTela() {

    JLabelPad lbLinha = new JLabelPad();
    lbLinha.setBorder(BorderFactory.createEtchedBorder());
    JLabelPad lbPeriodo = new JLabelPad("Periodo:", SwingConstants.CENTER);
    lbPeriodo.setOpaque(true);

    adic(lbPeriodo, 15, 5, 80, 20);
    adic(lbLinha, 7, 15, 320, 45);

    adic(new JLabelPad("De:", SwingConstants.CENTER), 17, 30, 40, 20);
    adic(txtDataini, 57, 30, 100, 20);
    adic(new JLabelPad("Até:", SwingConstants.CENTER), 157, 30, 45, 20);
    adic(txtDatafim, 202, 30, 100, 20);

    adic(new JLabelPad("Cód.Comis."), 7, 70, 90, 20);
    adic(txtCodComiss, 7, 90, 90, 20);
    adic(new JLabelPad("Nome do comissionado"), 100, 70, 227, 20);
    adic(txtNomeComiss, 100, 90, 227, 20);

    Calendar cPeriodo = Calendar.getInstance();
    txtDatafim.setVlrDate(cPeriodo.getTime());
    cPeriodo.set(Calendar.DAY_OF_MONTH, cPeriodo.get(Calendar.DAY_OF_MONTH) - 30);
    txtDataini.setVlrDate(cPeriodo.getTime());
  }
Example #29
0
    public PlayerView(String player) {
      playerName = new String(player);

      // Set-Up Top of Score Area
      namePanel = new JPanel();
      nameText = new JLabel(player);
      nameText.setFont(ScoreFont);
      namePanel.setLayout(new BorderLayout());
      namePanel.add(nameText, BorderLayout.CENTER);

      scorePanel = new JPanel();
      scoreText = new JLabel("  0");
      scoreText.setFont(ScoreFont);
      scorePanel.setLayout(new BorderLayout());
      scorePanel.add(scoreText, BorderLayout.CENTER);

      topPanel = new JPanel();
      BoxLayout layout = new BoxLayout(topPanel, BoxLayout.LINE_AXIS);

      topPanel.setLayout(layout);
      topPanel.add(namePanel);
      topPanel.add(Box.createRigidArea(new Dimension(10, 0)));
      topPanel.add(scorePanel);
      topPanel.add(Box.createRigidArea(new Dimension(10, 0)));

      // Create bordering for top panel
      Border raisedBevel, loweredBevel, compound;

      raisedBevel = BorderFactory.createRaisedBevelBorder();
      loweredBevel = BorderFactory.createLoweredBevelBorder();
      compound = BorderFactory.createCompoundBorder(raisedBevel, loweredBevel);
      topPanel.setBorder(compound);

      // Set-Up area to display word list
      wordPanel = new JPanel();
      Border etched = BorderFactory.createEtchedBorder();
      TitledBorder etchedTitle = BorderFactory.createTitledBorder(etched, "Word List");
      etchedTitle.setTitleJustification(TitledBorder.RIGHT);
      wordPanel.setBorder(etchedTitle);
      myWordList = new ExpandableList();
      myWordList.addActionListener(
          new ActionListener() {

            @Override
            public void actionPerformed(ActionEvent e) {
              String word = e.getActionCommand();
              java.util.List<BoardCell> list = myFinder.cellsForWord(myBoard, word);
              myBoardPanel.highlightDice(list);
            }
          });
      wordPanel.add(
          new JScrollPane(
              myWordList,
              JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
              JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED));

      setLayout(new BorderLayout(30, 30));
      add(topPanel, BorderLayout.NORTH);
      add(wordPanel, BorderLayout.CENTER);
    }
Example #30
0
  /** Creates the Find panel. */
  protected JPanel createFindPanel() {
    JPanel panel = new JPanel(new GridBagLayout());

    panel.setBorder(
        BorderFactory.createTitledBorder(
            BorderFactory.createEtchedBorder(), resources.getString("Panel.title")));

    ExtendedGridBagConstraints gbc = new ExtendedGridBagConstraints();
    gbc.insets = new Insets(2, 2, 2, 2);

    gbc.anchor = ExtendedGridBagConstraints.EAST;
    gbc.fill = ExtendedGridBagConstraints.NONE;
    gbc.setWeight(0, 0);
    gbc.setGridBounds(0, 0, 1, 1);
    panel.add(new JLabel(resources.getString("FindLabel.text")), gbc);

    gbc.fill = ExtendedGridBagConstraints.HORIZONTAL;
    gbc.setWeight(1.0, 0);
    gbc.setGridBounds(1, 0, 2, 1);
    panel.add(search = new JTextField(20), gbc);

    gbc.fill = ExtendedGridBagConstraints.NONE;
    gbc.anchor = ExtendedGridBagConstraints.WEST;
    gbc.setWeight(0, 0);
    gbc.setGridBounds(1, 1, 1, 1);
    caseSensitive = buttonFactory.createJCheckBox("CaseSensitiveCheckBox");
    panel.add(caseSensitive, gbc);

    return panel;
  }