public HDMColdAccountForm(final WalletListPanel walletListPanel) {
    this.walletListPanel = walletListPanel;

    inactiveBackGroundColor = Color.WHITE;
    selected = false;
    panelMain.setOpaque(true);
    panelMain.setFocusable(true);
    panelMain.setBackground(inactiveBackGroundColor);

    if (ColorAndFontConstants.isInverse()) {
      inactiveBackGroundColor =
          new Color(
              Math.min(255, Themes.currentTheme.detailPanelBackground().getRed() + 2 * COLOR_DELTA),
              Math.min(
                  255, Themes.currentTheme.detailPanelBackground().getBlue() + 2 * COLOR_DELTA),
              Math.min(
                  255, Themes.currentTheme.detailPanelBackground().getGreen() + 2 * COLOR_DELTA));
    } else {
      inactiveBackGroundColor =
          new Color(
              Math.max(0, Themes.currentTheme.detailPanelBackground().getRed() - COLOR_DELTA),
              Math.max(0, Themes.currentTheme.detailPanelBackground().getBlue() - COLOR_DELTA),
              Math.max(0, Themes.currentTheme.detailPanelBackground().getGreen() - COLOR_DELTA));
    }
    panelMain.applyComponentOrientation(
        ComponentOrientation.getOrientation(LocaliserUtils.getLocale()));

    updateFromModel();
    panelMain.addMouseListener(
        new WalletMouseListener(this.walletListPanel, HDMColdAccountForm.this));

    setSelected(false);
    setContent();
  }
  public void go() {
    picture();
    ActionListener listener = new BtListener();
    go.addActionListener(listener);
    btn_update_manual.addActionListener(listener);
    go.setForeground(Color.black);
    // rights.setFont((new Font("Arial", Font.PLAIN, 12)));
    title.setFont((new Font("Arial", Font.BOLD, 36)));
    title.setForeground(new Color(238, 253, 253));
    today.setFont((new Font("Arial", Font.BOLD, 16)));
    today.setForeground(new Color(163, 184, 204));
    frame.setLayout(new BorderLayout());
    from.setBackground(Color.white);
    to.setBackground(Color.white);
    converted.setFont(new Font("Arial", Font.BOLD, 24));
    converted.setForeground(new Color(238, 253, 253));
    Lfrom.setForeground(new Color(238, 253, 253));
    Lto.setForeground(new Color(238, 253, 253));
    quantity.setForeground(new Color(238, 253, 253));
    Lfrom.setFont(new Font("Arial", Font.BOLD, 24));
    Lto.setFont(new Font("Arial", Font.BOLD, 24));
    quantity.setFont(new Font("Arial", Font.BOLD, 24));
    north.setLayout(new FlowLayout());
    north.add(title);
    north.setBackground(new Color(59, 62, 71));
    frame.add(BorderLayout.NORTH, north);
    inner.setLayout(new BorderLayout());
    inner.add(BorderLayout.NORTH, today);
    inner.add(BorderLayout.WEST, picPanel);
    center.setLayout(new GridLayout(2, 4, 5, 5));
    center.add(Lfrom);
    center.add(from);
    center.add(Lto);
    center.add(to);
    center.add(quantity);
    center.add(amount);
    center.add(go);
    inner.setBackground(new Color(59, 62, 71));
    inner.add(BorderLayout.SOUTH, center);
    center.setBackground(new Color(59, 62, 71));
    frame.add(BorderLayout.CENTER, inner);
    south.setBackground(new Color(59, 62, 71));
    south.setLayout(new FlowLayout());
    south.add(converted);
    south.add(answer);
    south.add(btn_update_manual);
    // south.add(rights);
    frame.add(BorderLayout.SOUTH, south);
    frame.setSize(850, 700);
    frame.setVisible(true);

    frame.addWindowListener(
        new WindowAdapter() {
          public void windowClosing(WindowEvent event) {
            frame.setVisible(false);
            frame.dispose();
            System.exit(0);
          }
        });
  }
示例#3
0
  public SwingTest() {
    Container contentPane = getContentPane();

    pnTop.setBackground(Color.pink);
    pnCenter.setBackground(Color.YELLOW);
    pnBottom.setBackground(Color.BLUE);

    this.setLayout(new GridLayout(4, 1));

    pnTop.add(lbName);
    pnTop.setLayout(new FlowLayout());

    contentPane.add(pnTop);

    pnCenter.add(lbAge);
    contentPane.add(pnCenter);

    pnBottom.add(lbAddress);
    contentPane.add(pnBottom);

    pnResult.add(lbResult);
    contentPane.add(pnResult);

    Dimension screen = Toolkit.getDefaultToolkit().getScreenSize();

    int nXpos = (int) (screen.getWidth() / 2 - super.getWidth() / 2);
    int nYpos = (int) (screen.getHeight() / 2 - super.getHeight() / 2);
    setSize(nXpos, nYpos);
    setVisible(true);
  }
示例#4
0
文件: Board.java 项目: Zutazuta/Chess
  public JPanel drawBoard(Piece[][] boardState) throws IOException {

    boardFrame.removeAll();
    boardSquares = new JPanel[8][8];

    for (int i = 0; i < boardSquares.length; i++) {
      for (int j = 0; j < boardSquares.length; j++) {
        JPanel square = new JPanel();

        if ((j % 2 == 1 && i % 2 == 1) || (j % 2 == 0 && i % 2 == 0)) {
          square.setBackground(Color.WHITE);
          if (boardState[i][j] != null) {
            square.add(determinePiece(boardState[i][j]));
          }

        } else {
          square.setBackground(Color.gray);
          if (boardState[i][j] != null) {
            square.add(determinePiece(boardState[i][j]));
          }
        }
        boardFrame.add(square);
      }
    }
    return boardFrame;
  }
示例#5
0
文件: SetMap.java 项目: kkmehra/SE
  public void newframe() {
    JFrame frame = new JFrame("Cab Service ");
    frame.setSize(800, 600);

    frame.setVisible(true);
    // frame.setBackground(Color.CYAN);
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    JButton jb = new JButton("Set Name of Places ");
    jb.setBounds(100, 100, 20, 50);

    JPanel jp = new JPanel();
    jp.setBackground(Color.gray);
    jp.add(jb);
    frame.add(jp);
    JPanel jp1 = new JPanel();
    jp1.setBackground(Color.gray);
    frame.add(jp1);

    frame.add(jp);
    jb.addActionListener(
        new ActionListener() {

          public void actionPerformed(ActionEvent e) {
            try {
              CreateFrame();

            } catch (IOException ex) {
              Logger.getLogger(SetMap.class.getName()).log(Level.SEVERE, null, ex);
            }
          }
        });
  }
示例#6
0
  // Constructor
  public DeleteArchiveFrame(AmazonGlacierClient client, String vaultName, int region) {
    super("Delete Archive");

    int width = 200;
    int height = 170;

    Color wc = Color.WHITE;

    deleteClient = client;
    deleteVault = vaultName;

    JLabel label1 =
        new JLabel("ArchiveID to Delete from " + Endpoint.getTitleByIndex(region) + ":");
    jtfDeleteField = new JTextField(100);
    jbtDelete = new JButton("Delete");
    jbtBack = new JButton("Back");

    JPanel p1 = new JPanel();
    p1.setLayout(new FlowLayout());
    p1.add(label1);
    p1.setBackground(wc);

    JPanel p2 = new JPanel();
    p2.setLayout(new FlowLayout());
    p2.add(jtfDeleteField);
    jtfDeleteField.addMouseListener(new ContextMenuMouseListener());
    jtfDeleteField.setFocusable(true);
    p2.setBackground(wc);

    JPanel p3 = new JPanel();
    p3.setLayout(new FlowLayout());
    p3.add(jbtDelete);
    jbtDelete.addActionListener(this);
    jbtDelete.setBackground(wc);
    p3.add(jbtBack);
    jbtBack.addActionListener(this);
    jbtBack.setBackground(wc);
    p3.setBackground(wc);

    JPanel p4 = new JPanel();
    p4.setLayout(new BorderLayout());
    p4.setBackground(wc);
    p4.add(p1, BorderLayout.NORTH);
    p4.add(p2, BorderLayout.CENTER);
    p4.add(p3, BorderLayout.SOUTH);

    setContentPane(p4);

    // Prepare for display
    pack();
    if (width < getWidth()) // prevent setting width too small
    width = getWidth();
    if (height < getHeight()) // prevent setting height too small
    height = getHeight();
    centerOnScreen(width, height);
    jtfDeleteField.setText("");
    jtfDeleteField.requestFocus();
  }
  public TeacherManagePasswords() {
    super(new BorderLayout());
    setBackground(FWCConfigurator.bgColor);

    // Build title and north panel
    pnNorth = new JPanel(new FlowLayout(FlowLayout.CENTER));
    pnNorth.setBackground(FWCConfigurator.bgColor);
    lblTitle = new TitleLabel("Reset Passwords", FWCConfigurator.RESET_PASSW_TITLE_IMG);
    pnNorth.add(lblTitle);

    // Build center panel
    pnCenter = new JPanel(new BorderLayout());
    pnCenter.setBackground(FWCConfigurator.bgColor);

    // Build table of students
    tableModel = new DisabledTableModel();
    tableModel.setColumnIdentifiers(
        new String[] {"First Name", " Last " + "Name", "Username", "Class"});

    studentsTable = new JTable(tableModel);
    studentsTable.setAutoResizeMode(JTable.AUTO_RESIZE_ALL_COLUMNS);
    studentsTable.setFillsViewportHeight(true);
    studentsTable.getTableHeader().setFont(new Font("Calibri", Font.PLAIN, 18));
    studentsTable.setFont(new Font("Calibri", Font.PLAIN, 18));
    studentsTable.setRowHeight(studentsTable.getRowHeight() + 12);

    // Populate the table only with students that need a password reset
    students = FWCConfigurator.getTeacher().getStudentsRequestedReset();
    populateTable();

    tableScroll =
        new JScrollPane(
            studentsTable,
            JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
            JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
    tableScroll.setBackground(FWCConfigurator.bgColor);
    tableScroll.setBorder(
        BorderFactory.createCompoundBorder(
            new EmptyBorder(10, 100, 10, 100), new LineBorder(Color.black, 1)));

    pnCenter.add(tableScroll, BorderLayout.CENTER);

    // Build south panel
    pnButtons = new JPanel(new FlowLayout(FlowLayout.CENTER));
    pnButtons.setBackground(FWCConfigurator.bgColor);
    pnButtons.setBorder(BorderFactory.createEmptyBorder(0, 100, 20, 100));
    btnReset = new ImageButton("Reset Selected", FWCConfigurator.RESET_SELECTED_IMG, 150, 50);
    btnReset.addActionListener(new ResetListener());
    btnResetAll = new ImageButton("Reset All", FWCConfigurator.RESET_ALL_IMG, 150, 50);
    btnResetAll.addActionListener(new ResetListener());
    pnButtons.add(btnReset);
    pnButtons.add(btnResetAll);

    this.add(pnNorth, BorderLayout.NORTH);
    this.add(pnCenter, BorderLayout.CENTER);
    this.add(pnButtons, BorderLayout.SOUTH);
  }
 public void kosmetika() {
   setTitle("Knygų sąrašų demo - KTU IF 2012");
   panKnygųSar.setBorder(new TitledBorder("Visų knygų ir atrinktų knygų sąrašai"));
   panKnygųSar.setBackground(Color.lightGray);
   panDuomenys.setBorder(new TitledBorder("Knygų duomenys"));
   panDuomenys.setBackground(Color.lightGray);
   panAsmensDuo.setBackground(Color.white);
   panRez.setBackground(Color.white);
   panMygt.setBackground(Color.white);
 }
 public void kosmetika() {
   setTitle("Automobilių sąrašų demo - KTU IF 2010");
   panAutoSąr.setBorder(new TitledBorder("Visų automobilių ir atrinktų automobilių sąrašai"));
   panAutoSąr.setBackground(Color.yellow);
   panDuomenys.setBorder(new TitledBorder("Automobilių duomenys"));
   panDuomenys.setBackground(Color.lightGray);
   panAsmensDuo.setBackground(Color.green);
   panRez.setBackground(Color.gray);
   panMygt.setBackground(Color.magenta);
 }
  @Override
  public void actionPerformed(ActionEvent e) {
    JMenuItem item = (JMenuItem) e.getSource();

    if (item.getText().equals(DEFAULT_THEME)) {
      mainPanel.setBackground(Color.BLUE);
    } else if (item.getText().equals(CUSTOM_THEME)) {
      mainPanel.setBackground(Color.RED);
    }
  }
示例#11
0
  /**
   * Cr�e une nouvelle instance de CreeTrans
   *
   * @param mf fenetre principale de l'application
   * @param zg Zone graphique
   * @param auto automate
   * @param be barre d'�tat
   */
  public TransCreator(MainFrame mf, GraphicZone g, Automate auto, StateBar be) {

    super(JOptionPane.getFrameForComponent(mf), "Creating interaction", true);

    this.setResizable(false);

    this.gz = g;
    this.auto = auto;
    this.bar = be;
    this.mf = mf;

    be.displayInfo("Creating interaction");

    tfJPanel1 = new JPanel(new FlowLayout(FlowLayout.LEFT));
    tfJPanel1.setBackground(Color.lightGray);
    tfJPanel1.add(new JLabel("Type  : "));
    groupe = new CheckboxGroup();
    plus = new Checkbox("activator", groupe, true);
    tfJPanel1.add(plus);
    minus = new Checkbox("inhibitor", groupe, false);
    tfJPanel1.add(minus);

    tfJPanel2 = new JPanel(new FlowLayout(FlowLayout.LEFT));
    tfJPanel2.setBackground(Color.lightGray);
    tfJPanel2.add(new JLabel("Threshold  = "));
    tf = new JTextField(auto.nbrCharTransLabel);
    tf.setText("1");
    tfJPanel2.add(tf);

    btJPanel = new JPanel(new GridLayout(1, 2, 0, 0));
    btJPanel.setBackground(Color.lightGray);
    ok = new Button("Ok");
    ok.setBackground(Color.lightGray);
    ok.addActionListener(this);
    cancel = new Button("Cancel");
    cancel.setBackground(Color.lightGray);
    cancel.addActionListener(this);
    btJPanel.add(ok);
    btJPanel.add(cancel);

    content = this.getContentPane();
    content.setLayout(new BorderLayout());
    content.setBackground(Color.lightGray);
    content.add(tfJPanel1, BorderLayout.NORTH);
    content.add(tfJPanel2, BorderLayout.CENTER);
    content.add(btJPanel, BorderLayout.SOUTH);

    this.pack();
    this.setLocationRelativeTo(this.mf);

    tf.requestFocusInWindow();

    // rendre la fenetre visible
    setVisible(true);
  }
  public JPanel createContentPane() {

    // We create a bottom JPanel to place everything on.
    JPanel totalGUI = new JPanel();

    // We set the layout of the main JPanel to be BoxLayout.
    // LINE_AXIS sets them left to right, PAGE_AXIS sets them
    // from top to bottom.
    totalGUI.setLayout(new BoxLayout(totalGUI, BoxLayout.LINE_AXIS));

    JPanel redPanel = new JPanel();
    redPanel.setBackground(Color.red);
    redPanel.setMinimumSize(new Dimension(50, 50));
    redPanel.setPreferredSize(new Dimension(50, 50));
    totalGUI.add(redPanel);

    // This is the first spacer. This creates a spacer 10px wide that
    // will never get bigger or smaller.
    totalGUI.add(Box.createRigidArea(new Dimension(10, 0)));

    JPanel yellowPanel = new JPanel();
    yellowPanel.setBackground(Color.yellow);
    yellowPanel.setPreferredSize(new Dimension(50, 50));
    totalGUI.add(yellowPanel);

    // This spacer takes any spare space and places it as part of the spacer
    // If you drag the window wider, the space will get wider.
    totalGUI.add(Box.createHorizontalGlue());

    JPanel greenPanel = new JPanel();
    greenPanel.setBackground(Color.green);
    greenPanel.setPreferredSize(new Dimension(50, 50));
    totalGUI.add(greenPanel);

    // This spacer is a custom spacer.
    // The minimum size acts like a rigid area that
    // will not get any smaller than 10 pixels on the x-axis (horizontal)
    // and not get any smaller than 50 pixels on the y axis (vertical).
    // The way the maximum size is set up means the spacer acts like glue
    // and will expand to fit the available space.

    Dimension minSize = new Dimension(10, 50);
    Dimension prefSize = new Dimension(10, 50);
    Dimension maxSize = new Dimension(Short.MAX_VALUE, 50);
    totalGUI.add(new Box.Filler(minSize, prefSize, maxSize));

    JPanel bluePanel = new JPanel();
    bluePanel.setBackground(Color.blue);
    bluePanel.setPreferredSize(new Dimension(50, 50));
    totalGUI.add(bluePanel);

    totalGUI.setOpaque(true);
    return totalGUI;
  }
示例#13
0
  void initComponents() {
    JPanel mainPanel = new JPanel(new BorderLayout());
    JPanel buttonPanel = new JPanel();
    buttonPanel.setLayout(new BoxLayout(buttonPanel, BoxLayout.X_AXIS));
    Color bgColor = Color.getHSBColor(0.58f, 0.17f, 0.95f);
    buttonPanel.setBackground(bgColor);
    Border empty = BorderFactory.createEmptyBorder(5, 5, 5, 5);
    buttonPanel.setBorder(empty);

    textField = new JTextField(75);
    buttonPanel.add(textField);

    buttonPanel.add(Box.createHorizontalStrut(10));
    searchPHI = new JButton("Search PHI");
    searchPHI.addActionListener(this);
    buttonPanel.add(searchPHI);

    buttonPanel.add(Box.createHorizontalStrut(10));
    searchTrial = new JButton("Search Trial IDs");
    searchTrial.addActionListener(this);
    buttonPanel.add(searchTrial);

    buttonPanel.add(Box.createHorizontalStrut(20));
    buttonPanel.add(Box.createHorizontalGlue());
    saveAs = new JCheckBox("Save As...");
    saveAs.setBackground(bgColor);
    buttonPanel.add(saveAs);

    mainPanel.add(buttonPanel, BorderLayout.NORTH);

    JScrollPane scrollPane = new JScrollPane();
    textPane = new ColorPane();
    // textPane.setEditable(false);
    scrollPane.setViewportView(textPane);
    mainPanel.add(scrollPane, BorderLayout.CENTER);

    JPanel footerPanel = new JPanel();
    footerPanel.setLayout(new BoxLayout(footerPanel, BoxLayout.X_AXIS));
    footerPanel.setBackground(bgColor);
    message = new JLabel("Ready...");
    footerPanel.add(message);
    mainPanel.add(footerPanel, BorderLayout.SOUTH);

    setTitle(windowTitle);
    addWindowListener(
        new WindowAdapter() {
          public void windowClosing(WindowEvent evt) {
            System.exit(0);
          }
        });
    getContentPane().add(mainPanel, BorderLayout.CENTER);
    pack();
    centerFrame();
  }
 public void drawItems() {
   itemList.removeAll();
   OrderedItem orders[] = commande.getOrders();
   for (int i = 0; i < orders.length; i++) {
     GridBagConstraints constraintLeft = new GridBagConstraints(),
         constraintRight = new GridBagConstraints();
     constraintLeft.gridx = 0;
     constraintLeft.gridy = GridBagConstraints.RELATIVE;
     constraintLeft.fill = GridBagConstraints.HORIZONTAL;
     constraintRight.gridx = 1;
     constraintRight.gridy = GridBagConstraints.RELATIVE;
     constraintRight.fill = GridBagConstraints.HORIZONTAL;
     String itemText = orders[i].getItem().getNom();
     if (itemText.length() > 15) {
       itemText = itemText.substring(0, 12) + "...";
     }
     JLabel item = new JLabel(itemText);
     JPanel itemTextHolder = new JPanel();
     itemTextHolder.setBorder(BorderFactory.createLineBorder(Color.BLUE));
     itemTextHolder.setBackground(Color.WHITE);
     itemTextHolder.add(item);
     itemList.add(itemTextHolder, constraintLeft);
     Color bg = Color.WHITE;
     String statusIcon = "";
     JLabel itemStatus = new JLabel();
     JPanel statusHolder = new JPanel();
     switch (orders[i].getStatus()) {
       case 0:
         bg = Color.RED;
         statusIcon = "\u2718";
         break;
       case 1:
         bg = Color.YELLOW;
         statusIcon = "\u2718";
         break;
       case 2:
         bg = Color.GREEN;
         statusIcon = "\u2718";
         break;
       case 3:
         bg = Color.GRAY;
         statusIcon = "\u2713";
         break;
     }
     itemStatus.setText(statusIcon);
     statusHolder.setBackground(bg);
     statusHolder.setBorder(BorderFactory.createLineBorder(Color.BLUE));
     statusHolder.add(itemStatus);
     itemList.add(statusHolder, constraintRight);
   }
   validate();
   repaint();
 }
 private void kosmetika() {
   setTitle("Automobilių Queue ir Map struktūrų demo - KTU IF 2010");
   panAutoSąr.setBorder(
       new TitledBorder(
           "Neregistruotų automobilių eilė ir " + "registruotų automobilių Map struktūra"));
   panAutoSąr.setBackground(Color.yellow);
   panDuomenys.setBorder(new TitledBorder("Registracijos duomenys ir veiksmai"));
   panDuomenys.setBackground(Color.lightGray);
   panRegNumeris.setBackground(Color.green);
   panRez.setBackground(Color.gray);
   panMygt.setBackground(Color.magenta);
 }
示例#16
0
  private JPanel createBottomPanel() {
    JPanel bottomPanel = new JPanel(new BorderLayout());
    bottomPanel.setBackground(YAdminGUI._apiColour);

    JButton releaseButton = new JButton(_okCommand);
    releaseButton.setToolTipText("OK");
    releaseButton.addActionListener(this);
    JPanel p = new JPanel();
    p.setBackground(YAdminGUI._apiColour);
    p.add(releaseButton);
    bottomPanel.add(p, BorderLayout.EAST);
    return bottomPanel;
  }
示例#17
0
 // Set up the quiz window
 Quiz() {
   initializeData();
   setTitle("FOSS Quiz App");
   setDefaultCloseOperation(EXIT_ON_CLOSE);
   setSize(440, 400);
   setLocation(300, 100);
   setResizable(true);
   Container cont = getContentPane();
   cont.setLayout(null);
   cont.setBackground(Color.WHITE);
   bg = new ButtonGroup();
   choice1 = new JRadioButton("Choice1", true);
   choice2 = new JRadioButton("Choice2", false);
   choice3 = new JRadioButton("Choice3", false);
   choice4 = new JRadioButton("Choice4", false);
   bg.add(choice1);
   bg.add(choice2);
   bg.add(choice3);
   bg.add(choice4);
   lblmess = new JLabel("Choose a correct anwswer");
   lblmess.setForeground(Color.BLACK);
   lblmess.setFont(new Font("Sans_Serif", Font.BOLD, 15));
   btnext = new JButton("Next");
   btnext.setForeground(Color.WHITE);
   btnext.setFont(new Font("Sans_Serif", Font.BOLD, 17));
   btnext.setBackground(Color.DARK_GRAY);
   btnext.addActionListener(this);
   panel = new JPanel();
   panel.setBackground(Color.WHITE);
   panel.setLocation(10, 60);
   panel.setSize(400, 300);
   panel.setLayout(new GridLayout(0, 1));
   title = new JPanel();
   title.setBackground(Color.WHITE);
   title.setLocation(10, 10);
   title.setSize(1000, 50);
   title.setLayout(new GridLayout(1, 0));
   title.add(lblmess);
   panel.add(choice1);
   panel.add(choice2);
   panel.add(choice3);
   panel.add(choice4);
   panel.add(btnext);
   cont.add(title);
   cont.add(panel);
   setVisible(true);
   quizAnswerID = 0;
   readQuestionAnswer(quizAnswerID);
 }
  @Override
  protected JComponent getRowPresentation(
      ParameterTableModelItemBase<ParameterInfoImpl> item,
      boolean selected,
      final boolean focused) {
    final JPanel panel = new JPanel(new BorderLayout());
    final String typeText = item.typeCodeFragment.getText();
    final String separator =
        StringUtil.repeatSymbol(' ', getTypesMaxLength() - typeText.length() + 1);
    String text = typeText + separator + item.parameter.getName();
    final String defaultValue = item.defaultValueCodeFragment.getText();
    String tail = "";
    if (StringUtil.isNotEmpty(defaultValue)) {
      tail += " default value = " + defaultValue;
    }
    if (item.parameter.isUseAnySingleVariable()) {
      if (StringUtil.isNotEmpty(defaultValue)) {
        tail += ";";
      }
      tail += " Use any var.";
    }
    if (!StringUtil.isEmpty(tail)) {
      text += " //" + tail;
    }
    final EditorTextField field =
        new EditorTextField(" " + text, getProject(), getFileType()) {
          @Override
          protected boolean shouldHaveBorder() {
            return false;
          }
        };

    Font font = EditorColorsManager.getInstance().getGlobalScheme().getFont(EditorFontType.PLAIN);
    font = new Font(font.getFontName(), font.getStyle(), 12);
    field.setFont(font);

    if (selected && focused) {
      panel.setBackground(UIUtil.getTableSelectionBackground());
      field.setAsRendererWithSelection(
          UIUtil.getTableSelectionBackground(), UIUtil.getTableSelectionForeground());
    } else {
      panel.setBackground(UIUtil.getTableBackground());
      if (selected && !focused) {
        panel.setBorder(new DottedBorder(UIUtil.getTableForeground()));
      }
    }
    panel.add(field, BorderLayout.WEST);
    return panel;
  }
示例#19
0
 private void jbInit() throws Exception {
   setTitle("DIARIO CONTADO");
   frmDatosVenta = new FrmDatosVenta(engine);
   frmDatosVenta.setLocationRelativeTo(this);
   getContentPane().setLayout(borderLayout1);
   jLabel1.setFont(new java.awt.Font("Arial", Font.PLAIN, 18));
   jLabel1.setToolTipText("");
   jLabel1.setText("DIARIO DE ENTRADAS");
   pnlCentro.setLayout(borderLayout2);
   cmdCerrar.setText("CERRAR");
   cmdCerrar.addActionListener(new FrmDiarioDeEntradas_cmdCerrar_actionAdapter(this));
   cmdImprimir.setText("IMPRIMIR");
   tblDiario.setBackground(new Color(255, 240, 255));
   tblDiario.setFont(new java.awt.Font("Arial", Font.PLAIN, 12));
   tblDiario.setModel(modelDiarioVentasDeContado1);
   tblDiario.addMouseListener(new FrmDiarioDeEntradas_tblDiario_mouseAdapter(this));
   this.addWindowListener(new FrmDiarioDeEntradas_this_windowAdapter(this));
   jLabel2.setFont(new java.awt.Font("Arial", Font.BOLD, 20));
   jLabel2.setText("Total:");
   lblTotal.setFont(new java.awt.Font("Arial", Font.BOLD, 20));
   lblTotal.setText("");
   this.getContentPane().setBackground(Color.white);
   this.addKeyListener(new FrmDiarioDeEntradas_this_keyAdapter(this));
   pnlCentro.setBackground(Color.white);
   pnlNorte.setBackground(Color.white);
   pnlNorte.setLayout(borderLayout4);
   scrollDiario.getViewport().setBackground(Color.white);
   scrollDiario.setPreferredSize(new Dimension(800, 600));
   lblFecha.setFont(new java.awt.Font("Arial", Font.BOLD, 16));
   lblFecha.setText("");
   jPanel1.setLayout(borderLayout3);
   pnlSur.setMaximumSize(new Dimension(4000, 200));
   jPanel1.setBackground(Color.white);
   jPanel2.setBackground(Color.white);
   this.getContentPane().add(pnlCentro, java.awt.BorderLayout.CENTER);
   pnlCentro.add(pnlNorte, java.awt.BorderLayout.CENTER);
   pnlCentro.add(scrollDiario, java.awt.BorderLayout.NORTH);
   scrollDiario.getViewport().add(tblDiario);
   this.getContentPane().add(pnlSur, java.awt.BorderLayout.SOUTH);
   pnlSur.add(cmdImprimir);
   pnlSur.add(cmdCerrar);
   this.getContentPane().add(jPanel1, java.awt.BorderLayout.NORTH);
   jPanel1.add(lblFecha, java.awt.BorderLayout.EAST);
   jPanel1.add(jLabel1, java.awt.BorderLayout.WEST);
   pnlNorte.add(jPanel2, java.awt.BorderLayout.EAST);
   jPanel2.add(jLabel2);
   jPanel2.add(lblTotal);
   this.setDefaultCloseOperation(DISPOSE_ON_CLOSE);
 }
示例#20
0
  private JPanel createTopPanel(YWorkItem item) {
    JPanel topPanel = new JPanel(new BorderLayout());
    topPanel.setBackground(YAdminGUI._apiColour);

    JPanel leftPanel = new JPanel(new BorderLayout());
    leftPanel.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
    JTextArea explanatoryText = new JTextArea();
    explanatoryText.setText(
        "The data you submitted for this work item was \n"
            + "validated against a schema (see below).  For some reason the\n"
            + "this data did not succeed in passing the constrainst set\n"
            + "inside the schema.\n"
            + "Usage Note: If this is causing problems try using the Web server\n"
            + "version of YAWL, which supports automatic forms generation.\n"
            + "Otherwise you could copy the schema from this page and use it\n "
            + "to create a valid output document using an XML development tool.");
    explanatoryText.setEditable(false);
    explanatoryText.setFont(new Font("Arial", Font.BOLD, 12));
    explanatoryText.setForeground(Color.DARK_GRAY);
    explanatoryText.setBackground(YAdminGUI._apiColour);
    leftPanel.add(explanatoryText);
    topPanel.add(leftPanel, BorderLayout.WEST);

    JPanel rightPanel = new JPanel(new GridLayout(4, 2));

    rightPanel.setBackground(YAdminGUI._apiColour);
    rightPanel.setBorder(
        BorderFactory.createCompoundBorder(
            BorderFactory.createTitledBorder(
                BorderFactory.createEtchedBorder(), "Work Item Details"),
            BorderFactory.createEmptyBorder(10, 10, 10, 10)));
    YTask task =
        YEngine.getInstance().getTaskDefinition(item.getSpecificationID(), item.getTaskID());
    String taskName = task.getName();

    String[] text = {
      item.getSpecificationID().toString(), taskName, item.getIDString(), item.getStartTimeStr()
    };
    String[] labels = {"Specification ID", "Task Name", "WorkItem ID", "Task Started"};
    for (int i = 0; i < text.length; i++) {
      String s = text[i];
      rightPanel.add(new JLabel(labels[i]));
      JTextField t = new JTextField(s);
      t.setEditable(false);
      rightPanel.add(t);
    }
    topPanel.add(rightPanel, BorderLayout.CENTER);
    return topPanel;
  }
示例#21
0
 public void selectRow(int index) {
   int count = 0;
   for (JPanel row : rows) {
     if (count % 2 == 0) {
       row.setBackground(new Color(200, 200, 230));
     } else {
       row.setBackground(new Color(240, 240, 240));
     }
     ++count;
   }
   if (index != -1) {
     rows.get(index).setBackground(new Color(170, 250, 170));
   }
   repaint();
   updateUI();
 }
示例#22
0
  /** Description of the Method */
  public void init() {
    // super.init();
    size = new Dimension(570, 570);
    contentPane = (JPanel) this.getContentPane();
    contentPane.setLayout(borderLayout1);

    Dimension d = messagePanel.getSize();
    d.height += 20;
    messagePanel.setPreferredSize(d);
    contentPane.add(messagePanel, BorderLayout.SOUTH);

    contentPane.setOpaque(true);
    userPanel.setLayout(new GridBagLayout());
    GridBagConstraints gbc = new GridBagConstraints();
    gbc.anchor = GridBagConstraints.WEST;
    gbc.insets = new Insets(2, 2, 2, 2);

    messagePanel.setLayout(borderLayout5);
    contentPane.setOpaque(true);
    contentPane.setBackground(Color.white);
    this.setSize(size);

    messagePanel.add(labelMessage, BorderLayout.NORTH);
    // Logg.logg("MhClient: Före XttTree-skapande", 6);
    this.mhTable = new MhTable(root, false, this.labelMessage);
    // Logg.logg("MhClient: mhTable-skapande klart", 6);
    this.contentPane.add(this.mhTable.splitPane, BorderLayout.CENTER);
  }
示例#23
0
 public void createPanel() {
   panel = new JPanel(new GridLayout(3, 1)); // A panel object is created;
   panel.setBackground(Color.GREEN); // Set the background color of the panel
   panel.add(buttonPlus); // Add the button object to the panel
   panel.add(buttonMinus); // and the other one also.
   panel.add(text); // Add the text object to the panel.
 }
示例#24
0
  void makeFrame() {
    JPanel p = new JPanel();
    p.setBackground(Color.blue);
    p.setLayout(new BorderLayout(0, 0));
    p.setBorder(new EmptyBorder(0, GAP, GAP, GAP));
    days.setFont(BIG);
    days.setForeground(COLOR);
    p.add(days, "North");
    left.setFont(NORM);
    left.setForeground(COLOR);
    p.add(left, "South");

    JFrame f = new JFrame("Sayaç"); // a window
    f.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
    f.setContentPane(p);
    setDate();
    f.pack(); // minimal size
    f.setVisible(true); // show

    f.addWindowListener(
        new WindowAdapter() {
          public void windowClosing(WindowEvent e) {
            stop();
          }
        });
  }
  /**
   * Method to display pixel information for the passed x and y
   *
   * @param pictureX the x value in the picture
   * @param pictureY the y value in the picture
   */
  private void displayPixelInformation(int pictureX, int pictureY) {
    // check that this x and y are in range
    if (isLocationInPicture(pictureX, pictureY)) {
      // save the current x and y index
      colIndex = pictureX;
      rowIndex = pictureY;

      // get the pixel at the x and y
      Pixel pixel = new Pixel(picture, colIndex, rowIndex);

      // set the values based on the pixel
      colValue.setText(Integer.toString(colIndex + numberBase));
      rowValue.setText(Integer.toString(rowIndex + numberBase));
      rValue.setText("R: " + pixel.getRed());
      gValue.setText("G: " + pixel.getGreen());
      bValue.setText("B: " + pixel.getBlue());
      colorPanel.setBackground(new Color(pixel.getRed(), pixel.getGreen(), pixel.getBlue()));

    } else {
      clearInformation();
    }

    // notify the image display of the current x and y
    imageDisplay.setCurrentX((int) (colIndex * zoomFactor));
    imageDisplay.setCurrentY((int) (rowIndex * zoomFactor));
  }
  /**
   * Sets the background color.
   *
   * @param bg the new background
   */
  public void setBackground(Color bg) {
    super.setBackground(bg);

    if (dayChooser != null) {
      dayChooser.setBackground(bg);
    }
  }
示例#27
0
  private JPanel pracownikPanel() {
    FormLayout layout3 = new FormLayout("734", "15px, 485px");

    pracownikPanel = new JPanel(layout3);
    // pracownikPanel= new FormDebugPanel(layout3);
    CellConstraints cc = new CellConstraints();
    JLabel labell = new JLabel("Wyloguj");
    labell.addMouseListener(
        new MouseAdapter() {
          public void mousePressed(MouseEvent me) {
            CardLayout c1 = (CardLayout) (utworzPanel.getLayout());
            c1.show(utworzPanel, "card1");
            tx1.setText("");
            tx2.setText("");
          }
        });

    Color c = new Color(153, 180, 209);
    pracownikPanel.setBackground(c);
    tabbedPane2 = new JTabbedPane(JTabbedPane.LEFT);
    tabbedPane2.setBorder(null);
    tabbedPane2.addTab("Raport", new ImageIcon("images/spotkania.png"), new Raport());
    Font font = new Font("Arial", Font.BOLD, 15);
    tabbedPane2.setFont(font);

    tabbedPane2.setBackground(c);

    pracownikPanel.add(tabbedPane2, cc.xy(1, 2));
    pracownikPanel.add(labell, cc.xy(1, 1, CellConstraints.RIGHT, CellConstraints.TOP));
    return pracownikPanel;
  }
 private JComponent createRecentProjects() {
   JPanel panel = new JPanel(new BorderLayout());
   panel.add(new NewRecentProjectPanel(this), BorderLayout.CENTER);
   panel.setBackground(getProjectsBackground());
   panel.setBorder(new CustomLineBorder(getSeparatorColor(), JBUI.insetsRight(1)));
   return panel;
 }
  public UpgradesPanel(ORUIManager orUIManager) {
    super(BoxLayout.Y_AXIS);

    this.orUIManager = orUIManager;

    preferredSize = new Dimension((int) Math.round(100 * (2 + Scale.getFontScale()) / 3), 200);
    setSize(preferredSize);
    setVisible(true);

    upgradePanel = new JPanel();

    upgradePanel.setOpaque(true);
    upgradePanel.setBackground(Color.DARK_GRAY);
    upgradePanel.setBorder(border);
    upgradePanel.setLayout(new GridLayout(defaultNbPanelElements, 1));

    scrollPane = new JScrollPane(upgradePanel);
    scrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
    scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);
    scrollPane.setSize(getPreferredSize());

    doneButton.setActionCommand("Done");
    doneButton.setMnemonic(KeyEvent.VK_D);
    doneButton.addActionListener(this);
    cancelButton.setActionCommand("Cancel");
    cancelButton.setMnemonic(KeyEvent.VK_C);
    cancelButton.addActionListener(this);

    add(scrollPane);
  }
示例#30
0
 private JPanel kibicPanel() {
   FormLayout layout3 = new FormLayout("730", "15px, 485px");
   kibicPanel = new JPanel(layout3);
   // kibicPanel = new FormDebugPanel(layout3);
   CellConstraints cc = new CellConstraints();
   JLabel labell = new JLabel("Wyloguj");
   labell.addMouseListener(
       new MouseAdapter() {
         public void mousePressed(MouseEvent me) {
           CardLayout c1 = (CardLayout) (utworzPanel.getLayout());
           c1.show(utworzPanel, "card1");
           tx1.setText("");
           tx2.setText("");
         }
       });
   Color c = new Color(153, 180, 209);
   kibicPanel.setBackground(c);
   tabbedPane = new JTabbedPane(JTabbedPane.LEFT);
   tabbedPane.setBorder(null);
   tabbedPane.addTab("Spotkania", new ImageIcon("images/spotkania.png"), new Spotkania());
   Font font = new Font("Arial", Font.BOLD, 15);
   tabbedPane.setFont(font);
   tabbedPane.addTab("Król strzelców", new ImageIcon("images/krol.png"), new KrolStrzelcow());
   tabbedPane.addTab("Ranking drużyn", new ImageIcon("images/ranking.png"), new RankingDruzyn());
   // tabbedPane.addTab("")
   tabbedPane.setBackground(c);
   kibicPanel.add(tabbedPane, cc.xy(1, 2));
   kibicPanel.add(labell, cc.xy(1, 1, CellConstraints.RIGHT, CellConstraints.TOP));
   return kibicPanel;
 }