コード例 #1
0
ファイル: VCaretEntry.java プロジェクト: timburrow/OpenVnmrJ
  public VCaretEntry(SessionShare sshare, ButtonIF vif, String typ) {
    this.type = typ;
    this.vnmrIf = vif;
    this.fg = "black";
    this.fontSize = "8";
    setText("");
    setOpaque(false);
    orgBg = VnmrRgb.getColorByName("darkGray");
    setHorizontalAlignment(JTextField.LEFT);
    setMargin(new Insets(0, 2, 0, 2));

    ml =
        new MouseAdapter() {
          public void mouseClicked(MouseEvent evt) {
            int clicks = evt.getClickCount();
            int modifier = evt.getModifiers();
            if ((modifier & (1 << 4)) != 0) {
              if (clicks >= 2) ParamEditUtil.setEditObj((VObjIF) evt.getSource());
            }
          }
        };
    new DropTarget(this, this);
    DisplayOptions.addChangeListener(this);
    setEditable(true);
    caret = new VCaret();
    setCaret(caret);
    addCaretListener(this);
  }
コード例 #2
0
ファイル: VText.java プロジェクト: timburrow/OpenVnmrJ
  public VText(SessionShare sshare, ButtonIF vif, String typ) {
    this.vnmrIf = vif;
    setOpaque(false);
    setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);
    setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
    twin = new VTextWin(this, sshare, vif, typ);
    setViewportView(twin);
    JViewport vp = getViewport();
    vp.setBackground(Util.getBgColor());

    orgBg = getBackground();

    ml =
        new MouseAdapter() {
          public void mouseClicked(MouseEvent evt) {
            int clicks = evt.getClickCount();
            int modifier = evt.getModifiers();
            if ((modifier & (1 << 4)) != 0) {
              if (clicks >= 2) {
                ParamEditUtil.setEditObj((VObjIF) evt.getSource());
              }
            }
          }
        };
    new DropTarget(this, this);
    DisplayOptions.addChangeListener(this);
  }
コード例 #3
0
  /**
   * constructor
   *
   * @param sshare session share
   */
  public SpotterButton(SessionShare sshare) {
    JMenuItem item;

    this.sshare = sshare;

    //	setBackground(Global.BGCOLOR);
    setContentAreaFilled(false);
    // setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 5));
    setMargin(new Insets(0, 0, 0, 0));
    setBorder(new VButtonBorder());

    setUnderline(false);
    setIcon(Util.getImageIcon("search_20.png"));
    setToolTipText(Util.getLabel("_Locator_Statements"));

    addMouseListener(
        new MouseAdapter() {
          public void mousePressed(MouseEvent evt) {
            // Save startup time by not filling this menu until
            // it is first clicked.
            fillPopupMenu();
          }
        });

    addPopListener(
        new PopListener() {
          public void popHappened(String popStr) {

            SessionShare sshare = ResultTable.getSshare();
            if (popStr.startsWith("save:")) {
              String saveName = popStr.substring(5);
              StatementHistory history = sshare.statementHistory();
              history.readNamedStatement(saveName);
            } else if (popStr.startsWith("command:")) {
              String commandName = popStr.substring(8);
              int index = commandName.indexOf('/');
              String objType = commandName.substring(0, index);
              LocatorHistory lh = sshare.getLocatorHistory();
              // Set History Active Object type to this type.
              lh.setActiveObjType(objType);

              // Now get history for this type.
              StatementHistory history = sshare.statementHistory();
              history.appendLastOfType(commandName);
            } else if (popStr.startsWith("title:")) {
              String objType = popStr.substring(6);
              LocatorHistory lh = sshare.getLocatorHistory();
              // Update locator to the most recent statement for this type
              lh.setHistoryToThisType(objType);
            }
          }
        });
    DisplayOptions.addChangeListener(this);
  } // SpotterButton()
コード例 #4
0
ファイル: GLDemo.java プロジェクト: timburrow/OpenVnmrJ
  public GLDemo() {
    super(VNMRFrame.getVNMRFrame(), "Jogl Demo", false);

    DisplayOptions.addChangeListener(this);

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

    gradientPanel = createGradientPanel();

    contentPane.add(gradientPanel, BorderLayout.CENTER);

    checkBox = new JCheckBox("Transparent", true);
    checkBox.setActionCommand("transparancy");
    checkBox.addActionListener(this);
    optionsPan = new JPanel();
    optionsPan.setLayout(new SimpleH2Layout(SimpleH2Layout.LEFT, 5, 0, true, false));
    optionsPan.setBorder(new EtchedBorder(EtchedBorder.LOWERED));

    optionsPan.add(checkBox);

    runButton = new JToggleButton("Run");
    runButton.setActionCommand("run");
    runButton.setSelected(false);
    runButton.addActionListener(this);

    optionsPan.add(runButton);

    getContentPane().add(optionsPan, BorderLayout.SOUTH);
    setSize(300, 300);
    setLocation(300, 300);

    addWindowListener(
        new WindowAdapter() {
          public void windowClosing(WindowEvent e) {
            // Run this on another thread than the AWT event queue to
            // make sure the call to Animator.stop() completes before
            // exiting
            new Thread(
                    new Runnable() {
                      public void run() {
                        stop();
                      }
                    })
                .start();
          }
        });
    setVisible(false);
  }
コード例 #5
0
ファイル: LoginBox.java プロジェクト: timburrow/ovj3
  public LoginBox() {
    super("VnmrJ Login");

    dolayout("", "", "");
    setDefaultCloseOperation(JDialog.DO_NOTHING_ON_CLOSE);
    // setVast();
    DisplayOptions.addChangeListener(this);

    try {
      InetAddress inetAddress = InetAddress.getLocalHost();
      m_strHostname = inetAddress.getHostName();
    } catch (Exception e) {
      m_strHostname = "localhost";
    }

    VNMRFrame vnmrFrame = VNMRFrame.getVNMRFrame();
    Dimension size = vnmrFrame.getSize();
    position = vnmrFrame.getLocationOnScreen();
    AppIF appIF = Util.getAppIF();
    int h = appIF.statusBar.getSize().height;
    width = size.width;
    height = size.height - h;

    // Allow resizing and use the previous size and position
    // To stop resizing, use setResizable(false);
    readPersistence();

    //        setSize(width, height);
    //        setLocation(position);
    //        setResizable(false);

    setBackgroundColor(Util.getBgColor());

    m_trayTimer =
        new javax.swing.Timer(
            6000,
            new ActionListener() {
              public void actionPerformed(ActionEvent e) {
                setTrays();
              }
            });
  }