Exemplo n.º 1
0
  public Console() {
    super("Javacalculus Test GUI");
    setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    setResizable(false);
    System.setOut(new PrintStream(new consoleOutputStream()));
    // System.setErr(new PrintStream(new consoleOutputStream(true)));
    inputLabel.setLabelFor(input);
    input.setPreferredSize(new Dimension(300, 20));
    input.setBorder(BorderFactory.createLoweredBevelBorder());
    input.addKeyListener(this);
    commandHistory.add("");
    execute.addActionListener(this);
    execute.setBackground(Color.GREEN);
    execute.setForeground(Color.WHITE);
    console.setLineWrap(true);
    console.setWrapStyleWord(true);
    console.setEditable(false);
    console.setFont(new Font("Dialog", Font.BOLD, 14));
    JScrollPane consolePane =
        new JScrollPane(
            console,
            JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,
            JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);
    consolePane.setPreferredSize(new Dimension(600, 300));
    consolePane.setBorder(BorderFactory.createLoweredBevelBorder());
    //		error.setLineWrap(true);
    //		error.setWrapStyleWord(true);
    //		error.setEditable(false);
    //    	error.setFont(new Font("Dialog", Font.ITALIC, 12));
    //		JScrollPane errorPane = new JScrollPane(error, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,
    //				JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);
    //		errorPane.setBorder(BorderFactory.createLoweredBevelBorder());
    //		errorPane.setPreferredSize(new Dimension(600,300));
    // content.setPreferredSize(new Dimension(400,400));
    content.setLayout(new GridBagLayout());
    content.setBorder(BorderFactory.createLoweredBevelBorder());
    GridBagConstraints c = new GridBagConstraints();

    c.gridx = 0;
    c.gridy = 0;
    c.fill = GridBagConstraints.BOTH;
    content.add(inputLabel, c);
    c.gridx = 1;
    c.gridy = 0;
    content.add(input, c);
    c.gridx = 2;
    c.gridy = 0;
    content.add(execute, c);
    c.gridx = 0;
    c.gridy = 1;
    c.gridwidth = 3;
    content.add(consolePane, c);
    //		c.gridx = 0; c.gridy = 2;
    //		content.add(errorPane, c);
    add(content);

    pack();
    setVisible(true);
    input.requestFocus();
  }
Exemplo n.º 2
0
  public ManagerDeleteUser() {
    mm = new ManagerModel();
    Font f = new Font("ºÚÌå", Font.BOLD, 16);
    Container ct = this.getContentPane();
    ct.setLayout(null);
    jl1 = new JLabel("ɾ³ýµÄÓû§Ãû");
    jl1.setBounds(60, 150, 150, 30);
    jl1.setFont(f);
    jl1.setForeground(Color.black);
    ct.add(jl1);

    jtf = new JTextField();
    jtf.setBounds(170, 150, 130, 30);
    jtf.setBorder(BorderFactory.createLoweredBevelBorder());
    ct.add(jtf);

    jl2 = new JLabel("¹ÜÀíÔ±ÃÜÂë");
    jl2.setBounds(60, 190, 150, 30);
    jl2.setFont(f);
    jl2.setForeground(Color.black);
    ct.add(jl2);

    jpf = new JPasswordField(20);
    jpf.setBounds(170, 190, 130, 30);
    jpf.setBorder(BorderFactory.createLoweredBevelBorder());
    ct.add(jpf);

    jcon = new JButton("ɾ³ý");
    jcon.addActionListener(this);
    jcon.setFont(f);
    jcon.setBounds(60, 300, 70, 30);
    ct.add(jcon);

    jcancel = new JButton("È¡Ïû");
    jcancel.addActionListener(this);
    jcancel.setFont(f);
    jcancel.setBounds(240, 300, 70, 30);
    ct.add(jcancel);

    BackImage bi = new BackImage("IndexPic.jpg");
    bi.setBounds(0, 0, 360, 360);
    ct.add(bi);

    this.setUndecorated(true);
    this.setSize(360, 360);
    this.setLocationRelativeTo(null);
    this.setVisible(true);
  }
Exemplo n.º 3
0
 /**
  * _more_
  *
  * @param comp _more_
  * @param width _more_
  * @param height _more_
  * @return _more_
  */
 JScrollPane makeScroller(JComponent comp, int width, int height) {
   JScrollPane scroller = GuiUtils.makeScrollPane(comp, width, height);
   scroller.setBorder(BorderFactory.createLoweredBevelBorder());
   scroller.setPreferredSize(new Dimension(width, height));
   scroller.setMinimumSize(new Dimension(width, height));
   return scroller;
 }
Exemplo n.º 4
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);
    }
Exemplo n.º 5
0
  public StatusBar(final EventDispatcher dispatcher) {
    // GUI layout
    setLayout(new BorderLayout(2, 1));
    setPreferredSize(new Dimension(10, 23));
    setBorder(BorderFactory.createLoweredBevelBorder());

    statusLabel = new JLabel(" ");
    statusLabel.setForeground(Color.black);

    resizeHandle = new JPanel(new BorderLayout());
    resizeHandle.add(new JLabel(new ResizeHandleIcon()), BorderLayout.SOUTH);
    resizeHandle.setOpaque(false);

    add(statusLabel, BorderLayout.CENTER);
    add(resizeHandle, BorderLayout.EAST);

    // register events
    dispatcher.addHandler(ChangeCoordinate3DPointEvent.TYPE, this);
    dispatcher.addHandler(ChangeCoordinate4DPointEvent.TYPE, this);
    dispatcher.addHandler(Schlegel3DComputeEvent.TYPE, this);
    dispatcher.addHandler(Schlegel4DComputeEvent.TYPE, this);
    dispatcher.addHandler(ShowCoordinateEvent.TYPE, this);
    dispatcher.addHandler(ShowFundamentalDomainEvent.TYPE, this);
    dispatcher.addHandler(ShowLogEvent.TYPE, this);
    dispatcher.addHandler(ShowNextEvent.TYPE, this);
    dispatcher.addHandler(ShowPreviousEvent.TYPE, this);
    dispatcher.addHandler(Symmetry3DChooseEvent.TYPE, this);
    dispatcher.addHandler(TutorialEvent.TYPE, this);
  }
Exemplo n.º 6
0
  /** @param frameName title name for frame */
  public ShowSavedResults(String frameName) {
    super(frameName);
    aboutRes =
        new JTextArea(
            "Select a result set from"
                + "\nthose listed and details"
                + "\nof that analysis will be"
                + "\nshown here. Then you can"
                + "\neither delete or view those"
                + "\nresults using the buttons below.");
    aboutScroll = new JScrollPane(aboutRes);
    ss = new JScrollPane(sp);
    ss.getViewport().setBackground(Color.white);

    //  resMenu.setLayout(new FlowLayout(FlowLayout.LEFT,10,1));
    ClassLoader cl = getClass().getClassLoader();
    rfii = new ImageIcon(cl.getResource("images/Refresh_button.gif"));

    // results status
    resButtonStatus = new JPanel(new BorderLayout());
    Border loweredbevel = BorderFactory.createLoweredBevelBorder();
    Border raisedbevel = BorderFactory.createRaisedBevelBorder();
    Border compound = BorderFactory.createCompoundBorder(raisedbevel, loweredbevel);
    statusField = new JTextField();
    statusField.setBorder(compound);
    statusField.setEditable(false);
  }
Exemplo n.º 7
0
  public AddAccount() {
    this.setLayout(new FlowLayout(FlowLayout.LEFT));
    loweredbevel = BorderFactory.createLoweredBevelBorder();
    layoutPanel = new JPanel();
    layoutPanel.setLayout(new GridBagLayout());
    GridBagConstraints gbc = new GridBagConstraints();
    gbc.insets = new Insets(0, 10, 5, 2);
    lbUserName = new JLabel("Username:"******"Balance:");
    txfUserName = new JTextField(15);
    txfBalance = new JTextField(15);
    btnAdd = new JButton("Add");
    btnAdd.addActionListener(this);

    gbc.anchor = GridBagConstraints.EAST; // Flyttar  all objekt till höger
    gbc.gridx = 0;
    gbc.gridy = 0;
    layoutPanel.add(lbUserName, gbc);
    gbc.gridx = 1;
    gbc.gridy = 0;
    layoutPanel.add(txfUserName, gbc);
    gbc.gridx = 0;
    gbc.gridy = 1;
    layoutPanel.add(lbBalance, gbc);
    gbc.gridx = 1;
    gbc.gridy = 1;
    layoutPanel.add(txfBalance, gbc);
    gbc.gridx = 1;
    gbc.gridy = 2;
    layoutPanel.add(btnAdd, gbc);
    add(layoutPanel);
  } // end konstruktor
Exemplo n.º 8
0
 public UValueLabel(String s) {
   super(s);
   setOpaque(true);
   setHorizontalAlignment(SwingConstants.RIGHT);
   setBorder(BorderFactory.createLoweredBevelBorder());
   setForeground(Color.black);
   setBackground(Color.white);
 }
Exemplo n.º 9
0
 private JRadioButton getRegionButton(
     JRadioButton button, int x, int y, int w, int h, String tip) {
   button.setBounds(new Rectangle(x, y, w, h));
   button.setBorder(BorderFactory.createLoweredBevelBorder());
   button.setToolTipText(Messages.getString(tip));
   button.addActionListener(alRegion);
   regionButtons.add(button);
   return button;
 }
Exemplo n.º 10
0
  /** 初始化操作 添加按钮 */
  private void init() {
    addButton(panel1, "Backspace", new Clear(), Color.red);
    addButton(panel1, "CE", new Clear(), Color.red);
    addButton(panel1, "C", new Clear(), Color.red);
    addButton(panel2, "1/x", new Signs(), Color.magenta);
    addButton(panel2, "log", new Signs(), Color.magenta);
    addButton(panel2, "7", numActionListener, Color.blue);
    addButton(panel2, "8", numActionListener, Color.blue);
    addButton(panel2, "9", numActionListener, Color.blue);
    addButton(panel2, "÷", new Signs(), Color.red);
    addButton(panel2, "n!", new Signs(), Color.magenta);
    addButton(panel2, "sqrt", new Signs(), Color.magenta);
    addButton(panel2, "4", numActionListener, Color.blue);
    addButton(panel2, "5", numActionListener, Color.blue);
    addButton(panel2, "6", numActionListener, Color.blue);
    addButton(panel2, "×", new Signs(), Color.red);
    addButton(panel2, "sin", new Signs(), Color.magenta);
    addButton(panel2, "x^2", new Signs(), Color.magenta);
    addButton(panel2, "1", numActionListener, Color.blue);
    addButton(panel2, "2", numActionListener, Color.blue);
    addButton(panel2, "3", numActionListener, Color.blue);
    addButton(panel2, "-", new Signs(), Color.red);
    addButton(panel2, "cos", new Signs(), Color.magenta);
    addButton(panel2, "x^3", new Signs(), Color.magenta);
    addButton(panel2, "0", numActionListener, Color.blue);
    addButton(panel2, "-/+", new Clear(), Color.blue);
    addButton(panel2, ".", new Dot(), Color.blue);
    addButton(panel2, "+", new Signs(), Color.red);
    addButton(panel2, "tan", new Signs(), Color.magenta);
    addButton(panel2, "%", new Signs(), Color.magenta);
    addButton(panel2, "π", numActionListener, Color.orange);
    addButton(panel2, "e", numActionListener, Color.orange);
    addButton(panel2, "′″", new Signs(), Color.orange);
    addButton(panel2, "=", new Signs(), Color.red);

    JButton btns = new JButton("计算器");
    btns.setBorder(BorderFactory.createLoweredBevelBorder());
    btns.setEnabled(false); // 按钮不可操作
    btns.setPreferredSize(new Dimension(20, 20));

    panel3.add(btns); // 加入按钮
    addButton(panel3, "MC", null, Color.red);
    addButton(panel3, "MR", null, Color.red);
    addButton(panel3, "MS", null, Color.red);
    addButton(panel3, "M+", null, Color.red);

    panel4.add(panel1, BorderLayout.NORTH);
    panel4.add(panel2, BorderLayout.CENTER);
    this.add(tf, BorderLayout.NORTH);
    this.add(panel3, BorderLayout.WEST);
    this.add(panel4);

    pack();
    this.setResizable(false); // 窗口不可改变大小
    this.setLocation(300, 200);
    this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  }
Exemplo n.º 11
0
 private JRadioButton getShapeButton(
     JRadioButton button, int x, int y, int w, int h, String tip, Shp shp, Obj obj) {
   button.setBounds(new Rectangle(x, y, w, h));
   button.setBorder(BorderFactory.createLoweredBevelBorder());
   button.setToolTipText(Messages.getString(tip));
   button.addActionListener(alShape);
   shapeButtons.add(button);
   shapes.put(shp, button);
   objects.put(shp, obj);
   return button;
 }
  private Component crearPanelWebcam() {
    panatallaLeap = new JPanel(new BorderLayout());
    panatallaLeap.setBorder(BorderFactory.createLoweredBevelBorder());

    GraphicsConfiguration gc = SimpleUniverse.getPreferredConfiguration();
    visualizador = new Canvas3D(gc);

    panatallaLeap.add(visualizador, BorderLayout.CENTER);

    return panatallaLeap;
  }
Exemplo n.º 13
0
  private void JPanelInit() {
    // Reserva de memoria para los JPanel.
    jPanelTitle = new JPanel();
    jPanelMain = new JPanel();

    // Establecimiento de sus tama�os, bordes y layout.
    jPanelTitle.setLayout(null);
    jPanelMain.setBorder(BorderFactory.createLoweredBevelBorder());
    jPanelMain.setBounds(new Rectangle(10, 50, 407, 60));
    jPanelMain.setLayout(null);
  }
  private Component crearPanelImagen() {
    JPanel panel = new JPanel(new GridLayout(1, 1));
    panel.setBorder(BorderFactory.createLoweredBevelBorder());

    pantallaImagen = new JLabel();
    pantallaImagen.setHorizontalAlignment(JLabel.CENTER);
    pantallaImagen.setVerticalAlignment(JLabel.CENTER);

    panel.add(pantallaImagen);

    return panel;
  }
  private Component crearPanelDescripcion() {
    JPanel panel = new JPanel(new GridLayout(1, 1));
    panel.setPreferredSize(new Dimension(0, 50));
    panel.setBorder(BorderFactory.createLoweredBevelBorder());
    textoDescripcion = new JLabel(" ");
    textoDescripcion.setHorizontalAlignment(SwingConstants.CENTER);
    textoDescripcion.setVerticalAlignment(SwingConstants.CENTER);

    panel.add(textoDescripcion);

    return panel;
  }
Exemplo n.º 16
0
  public static void main(String[] args) {
    try {
      UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
      LookAndFeelFactory.installJideExtension();
    } catch (ClassNotFoundException e) {
    } catch (InstantiationException e) {
    } catch (IllegalAccessException e) {
    } catch (UnsupportedLookAndFeelException e) {
    }

    _frame = new JideButtonDemo("Demo of JideButton");
    _frame.setIconImage(JideIconsFactory.getImageIcon(JideIconsFactory.JIDE32).getImage());
    _frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

    JPanel panel = new JPanel(new GridLayout(6, 1));
    _buttons = new JideButton[6];
    _buttons[0] =
        createHyperlinkButton(
            "Rename this file",
            ButtonsIconsFactory.getImageIcon(ButtonsIconsFactory.Buttons.RENAME));
    _buttons[1] =
        createHyperlinkButton(
            "Move this file", ButtonsIconsFactory.getImageIcon(ButtonsIconsFactory.Buttons.MOVE));
    _buttons[2] =
        createHyperlinkButton(
            "Copy this file", ButtonsIconsFactory.getImageIcon(ButtonsIconsFactory.Buttons.COPY));
    _buttons[3] =
        createHyperlinkButton(
            "Publish this file",
            ButtonsIconsFactory.getImageIcon(ButtonsIconsFactory.Buttons.PUBLISH));
    _buttons[4] =
        createHyperlinkButton(
            "Email this file", ButtonsIconsFactory.getImageIcon(ButtonsIconsFactory.Buttons.EMAIL));
    _buttons[5] =
        createHyperlinkButton(
            "Delete this file",
            ButtonsIconsFactory.getImageIcon(ButtonsIconsFactory.Buttons.DELET));
    for (int i = 0; i < _buttons.length; i++) {
      JideButton button = _buttons[i];
      panel.add(button);
    }

    panel.setBorder(BorderFactory.createEmptyBorder(12, 12, 12, 12));
    _frame.getContentPane().setLayout(new BorderLayout());
    _frame.getContentPane().add(createOptionsPanel(), BorderLayout.AFTER_LINE_ENDS);
    JPanel topPanel = JideSwingUtilities.createTopPanel(panel);
    topPanel.setBorder(BorderFactory.createLoweredBevelBorder());
    _frame.getContentPane().add(topPanel, BorderLayout.CENTER);

    _frame.setBounds(10, 10, 300, 500);

    _frame.setVisible(true);
  }
Exemplo n.º 17
0
 /**
  * Static Init
  *
  * @throws Exception
  */
 void jbInit() throws Exception {
   mainPanel.setLayout(mainLayout);
   mainLayout.setHgap(2);
   mainLayout.setVgap(2);
   infoPane.setBorder(BorderFactory.createLoweredBevelBorder());
   infoPane.setPreferredSize(new Dimension(500, 400));
   getContentPane().add(mainPanel);
   mainPanel.add(infoPane, BorderLayout.CENTER);
   mainPanel.add(confirmPanel, BorderLayout.SOUTH);
   infoPane.getViewport().add(info, null);
   confirmPanel.addActionListener(this);
 } //	jbInit
 /*     */ private JScrollPane getScrollPane1() /*     */ {
   /* 365 */ if (this.scrollPane1 == null) {
     /* 366 */ this.scrollPane1 = new JScrollPane();
     /* 367 */ this.scrollPane1.setBorder(
         new CompoundBorder(
             BorderFactory.createLoweredBevelBorder(),
             BorderFactory.createEmptyBorder(10, 10, 10, 10)));
     /*     */
     /* 369 */ this.scrollPane1.getViewport().add(getTabla());
     /*     */ }
   /* 371 */ return this.scrollPane1;
   /*     */ }
Exemplo n.º 19
0
  /** Creates a new frame with an empty status bar. */
  public PFrame() {
    super();
    this.statusBar = new JPanel();
    this.statusBar.setBorder(BorderFactory.createLoweredBevelBorder());
    this.statusBar.setLayout(new FlowLayout(FlowLayout.RIGHT));
    this.statusBar.setMinimumSize(new Dimension(0, 40));
    this.statusBarText = new JLabel();
    this.statusBar.add(this.statusBarText);
    this.pComponents = new JPanel();

    this.getContentPane().setLayout(new BorderLayout());
    this.getContentPane().add(this.statusBar, BorderLayout.SOUTH);
    this.getContentPane().add(this.pComponents, BorderLayout.CENTER);
  }
Exemplo n.º 20
0
  public void addItem(String name) {
    JTextField txtItem = new JTextField();
    txtItem.setEditable(false);
    txtItem.setBorder(BorderFactory.createLoweredBevelBorder());
    txtItem.setToolTipText(Messages.getString(name));

    Dimension dim = new Dimension(100, 20);
    txtItem.setMinimumSize(dim);
    txtItem.setMaximumSize(dim);
    txtItem.setPreferredSize(dim);

    _items.put(name, txtItem);
    _statusPanel.add(txtItem);
  }
Exemplo n.º 21
0
  private void JLabelInit() {
    // Reserva de memoria par los JLabel.
    jLabelTitle = new JLabel();
    jLabelCourse = new JLabel();

    // Establecimiento de sus tama�os, textos y  bordes.
    jLabelTitle.setFont(new java.awt.Font("Dialog", 1, 16));
    jLabelTitle.setBorder(BorderFactory.createLoweredBevelBorder());
    jLabelTitle.setHorizontalAlignment(SwingConstants.CENTER);
    jLabelTitle.setText(this.getTitle());
    jLabelTitle.setBounds(new Rectangle(10, 5, 407, 44));

    jLabelCourse.setBounds(new Rectangle(20, 17, 50, 17));
    jLabelCourse.setText("Course:");
    jLabelCourse.setFont(new java.awt.Font("Dialog", 1, 12));
  }
  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;
  }
Exemplo n.º 23
0
  /**
   * Default constructor
   *
   * @param fastTextView The FastTextView to wrap
   */
  public FastTextPane(FastTextView fastTextView) {

    super(new BorderLayout());

    this.scrollBar = new JScrollBar(JScrollBar.VERTICAL, 0, 10, 0, 10);
    this.scrollBar.addAdjustmentListener(this);
    this.scrollBar.setVisible(false);

    add(this.scrollBar, BorderLayout.EAST);

    setBorder(BorderFactory.createLoweredBevelBorder());
    this.fastTextView = fastTextView;
    this.fastTextView.addFastTextViewListener(this);
    this.fastTextView.addMouseWheelListener(this);

    add(this.fastTextView);
  }
Exemplo n.º 24
0
  protected void setUpSRSFrame(URL url, String search) throws IOException {
    if (BigPane.srsFrame == null) {
      BigPane.setUpSRSFrame((2 * desktop.getHeight()) / 3, desktop);
      Border loweredbevel = BorderFactory.createLoweredBevelBorder();
      Border raisedbevel = BorderFactory.createRaisedBevelBorder();
      Border compound = BorderFactory.createCompoundBorder(raisedbevel, loweredbevel);

      JTextField statusField = new JTextField();
      statusField.setBorder(compound);
      statusField.setEditable(false);
      BigPane.srsFrame.getContentPane().add(statusField, BorderLayout.SOUTH);
    }

    Annotation edPane = new Annotation(url);
    JScrollPane jsp = new JScrollPane(edPane);
    JTabbedPane jtab = (JTabbedPane) BigPane.srsFrame.getContentPane().getComponent(0);
    jtab.insertTab(search, null, jsp, null, 0);
    BigPane.srsFrame.setVisible(true);
  }
  public EdgeStyleManager(MapCanvas canvas) {

    setTitle("Edge Style Manager");

    this.canvas = canvas;
    this.styles = canvas.getModel().edgeStyles;

    jlistModel = new DefaultListModel();
    for (int i = 0; i < styles.size(); i++)
      jlistModel.addElement(((LineStyle) styles.get(i)).getId());
    jlist = new JList(jlistModel);
    jlist.addListSelectionListener(this);
    jlist.setFixedCellWidth(100);
    JScrollPane sp = new JScrollPane(jlist);

    setLayout(new GridLayout(1, 2));
    JPanel p1 = new JPanel(new BorderLayout(5, 5));
    JPanel p2 = new JPanel();
    JPanel p3 = new JPanel(new GridLayout(1, 3));

    btnAdd = new JButton("Add");
    btnAdd.addActionListener(this);
    btnEdit = new JButton("Edit");
    btnEdit.addActionListener(this);
    btnDel = new JButton("Del");
    btnDel.addActionListener(this);

    p3.add(btnAdd);
    p3.add(btnEdit);
    p3.add(btnDel);

    p2.add(p3);
    p1.add(p2, BorderLayout.SOUTH);
    p1.add(sp, BorderLayout.CENTER);
    add(p1);

    preview = new EdgeStylePreview();
    JPanel p4 = new JPanel(new BorderLayout());
    p4.setBorder(BorderFactory.createLoweredBevelBorder());
    p4.add(preview);
    add(p4);
  }
Exemplo n.º 26
0
    /** Initializes the header. */
    private void initHeader() {
      boolean isSaturday = false, isSunday = false;
      int field = 0, value = 0;
      switch (layout) {
        case HORIZONTAL:
          isSaturday = (col + firstInWeek) % weekCount == 0;
          isSunday = (col + firstInWeek) % weekCount == 1;
          field = Calendar.DATE;
          value = calendar.getMinimum(Calendar.DATE) + col;
          break;
        case VERTICAL:
          isSaturday = (row + firstInWeek) % weekCount == 0;
          isSunday = (row + firstInWeek) % weekCount == 1;
          field = Calendar.DATE;
          value = calendar.getMinimum(Calendar.DATE) + row;
          break;
        case TABLE:
        default:
          isSaturday = col == Calendar.SATURDAY - firstDayOfWeek;
          isSunday = col == (weekCount - (firstDayOfWeek - Calendar.SUNDAY)) % weekCount;
          field = Calendar.DAY_OF_WEEK;
          value = (calendar.getFirstDayOfWeek() + col) % weekCount;
      }

      if (isSaturday) {
        setForeground(colors.fgSaturday);
      } else if (isSunday) {
        setForeground(colors.fgSunday);
      } else {
        setForeground(colors.fgCell);
      }
      setHorizontalAlignment(JLabel.CENTER);
      setVerticalAlignment(JLabel.CENTER);
      setFont(MonthCalendarImpl.this.getFont());
      int current = calendar.get(field);
      calendar.set(field, value);
      setText(weekPattern.format(calendar.getTime()));
      calendar.set(field, current); // Resume the date
      setBorder(BorderFactory.createLoweredBevelBorder());
    }
Exemplo n.º 27
0
  public static void main(String[] args) {
    // create a JFrame to hold everything
    JFrame frame = new JFrame("Borders");

    // Create labels with borders.
    int center = SwingConstants.CENTER;
    JLabel labelOne = new JLabel("raised BevelBorder", center);
    labelOne.setBorder(BorderFactory.createBevelBorder(BevelBorder.RAISED));
    JLabel labelTwo = new JLabel("EtchedBorder", center);
    labelTwo.setBorder(BorderFactory.createEtchedBorder());
    JLabel labelThree = new JLabel("MatteBorder", center);
    labelThree.setBorder(BorderFactory.createMatteBorder(10, 10, 10, 10, Color.pink));
    JLabel labelFour = new JLabel("TitledBorder", center);
    Border etch = BorderFactory.createEtchedBorder();
    labelFour.setBorder(BorderFactory.createTitledBorder(etch, "Title"));
    JLabel labelFive = new JLabel("TitledBorder", center);
    Border low = BorderFactory.createLoweredBevelBorder();
    labelFive.setBorder(
        BorderFactory.createTitledBorder(low, "Title", TitledBorder.RIGHT, TitledBorder.BOTTOM));
    JLabel labelSix = new JLabel("CompoundBorder", center);
    Border one = BorderFactory.createEtchedBorder();
    Border two = BorderFactory.createMatteBorder(4, 4, 4, 4, Color.blue);
    labelSix.setBorder(BorderFactory.createCompoundBorder(one, two));

    // add components to the content pane
    Container c = frame.getContentPane(); // unecessary in 1.5+
    c.setLayout(new GridLayout(3, 2));
    c.add(labelOne);
    c.add(labelTwo);
    c.add(labelThree);
    c.add(labelFour);
    c.add(labelFive);
    c.add(labelSix);

    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    frame.pack();
    frame.setVisible(true);
  }
  public static JComponent createContent() {
    actionListener = getButtonListener();

    JPanel contentPane = new JPanel(new BorderLayout());
    webBrowserPanel = new JPanel(new BorderLayout());
    webBrowserPanel.setBorder(BorderFactory.createTitledBorder("Server"));
    final JWebBrowser webBrowser = new JWebBrowser();
    webBrowser.navigate("http://www.google.com");
    webBrowser.setBarsVisible(false);

    webBrowserPanel.add(webBrowser, BorderLayout.CENTER);
    webBrowserPanel.setVisible(false);
    contentPane.add(webBrowserPanel, BorderLayout.CENTER);
    // Create an additional bar allowing to show/hide the menu bar of the web browser.

    buttonOn = new JButton(" Turn On");
    buttonOff = new JButton("Turn Off");
    buttonOff.setVisible(false);
    buttonOn.setVisible(true);

    buttonOn.addActionListener(actionListener);
    buttonOff.addActionListener(actionListener);

    JPanel buttonPanel = new JPanel(new FlowLayout(FlowLayout.LEFT, 4, 4));
    powerPanel = new JPanel(new BorderLayout());
    powerPanel.setPreferredSize(new Dimension(95, 30));
    powerPanel.add(buttonOn, BorderLayout.WEST);
    powerPanel.add(buttonOff, BorderLayout.EAST);
    powerPanel.setBackground(Color.WHITE);
    //	  powerPanel.setBorder(BorderFactory.createLineBorder(Color.decode("#000")));

    powerPanel.setBorder(BorderFactory.createLoweredBevelBorder());
    buttonPanel.add(powerPanel);
    contentPane.add(buttonPanel, BorderLayout.SOUTH);

    return contentPane;
  }
Exemplo n.º 29
0
  QueryBuilder(Main_Frame parent, String path, ArrayList<String> tableNames) {
    // Constructor Instances.
    String pathDirectory, localeDirectory;
    MenuActionListener pluginMenuListener;

    // Setup the Main panel and the plugin's components.

    queryBuilderMainPanel = new JPanel(new BorderLayout());

    // file & http, locale resource not in jar
    pathDirectory = path + "/" + "QueryBuilder" + "/";
    localeDirectory = "locale/";
    imagesDirectory = "images/icons/";

    // file & http, locale resource in jar
    // pathDirectory = path + "/" + "QueryBuilder.jar";
    // localeDirectory = "lib/plugins/QueryBuilder/locale/";
    // imagesDirectory = "lib/plugins/QueryBuilder/images/icons/";

    resourceBundle = new AResourceBundle(pathDirectory, Ajqvue.getDebug());
    resourceBundle.setLocaleResource(localeDirectory, "QueryBuilder", Ajqvue.getLocaleString());

    tabIcon = resourceBundle.getResourceImage(imagesDirectory + "queryBuilderIcon.png");

    // QueryBuilder Pane.
    queryBuilderPane = new QueryBuilderPane(imagesDirectory, resourceBundle, tableNames);
    queryBuilderPane.setBorder(BorderFactory.createLoweredBevelBorder());
    queryBuilderMainPanel.add(queryBuilderPane, BorderLayout.CENTER);

    // Setup the MenuBar and ToolBar to be used by the plugin.

    pluginMenuListener = new MenuActionListener(parent, queryBuilderPane, resourceBundle);
    menuBar = new QueryBuilder_MenuBar(parent, resourceBundle, pluginMenuListener);
    toolBar =
        new QueryBuilder_ToolBar(
            "QueryBuilder ToolBar", parent, imagesDirectory, resourceBundle, pluginMenuListener);
  }
Exemplo n.º 30
0
  public MonthPanel(int year, int month, int active) {
    this.month = month;
    this.year = year;

    Calendar c = Calendar.getInstance();
    c.clear();
    c.set(year, month, 1);
    days = c.getActualMaximum(c.DAY_OF_MONTH);
    int weekDay = (c.get(c.DAY_OF_WEEK) - c.MONDAY + 7) % 7;

    jlMonth = new JLabel(monthName[month] + " " + year + ".");
    jlMonth.setHorizontalAlignment(SwingConstants.CENTER);

    jlDay = new JLabel[7];
    for (int i = 0; i < 7; i++) {
      jlDay[i] = new JLabel(" " + dayName[i] + " ");
      jlDay[i].setHorizontalAlignment(SwingConstants.CENTER);
    }

    day = new DayLabel[days];
    for (int i = 0; i < days; i++) day[i] = new DayLabel(i + 1, (i >= active) && (active >= 0));

    jpMain = new JPanel(new GridLayout(0, 7));
    for (int i = 0; i < 7; i++) jpMain.add(jlDay[i]);
    for (int i = 0; i < weekDay; i++) jpMain.add(new DayLabel(0, false));
    for (int i = 0; i < days; i++) jpMain.add(day[i]);
    for (int i = weekDay + days; i < 42; i++) jpMain.add(new DayLabel(100, false));

    jpMain.setBorder(
        BorderFactory.createCompoundBorder(
            BorderFactory.createEmptyBorder(2, 0, 0, 0), BorderFactory.createLoweredBevelBorder()));

    this.setLayout(new BorderLayout());
    this.add(jlMonth, BorderLayout.NORTH);
    this.add(jpMain, BorderLayout.CENTER);
  }