예제 #1
0
  private EntityPallet() {

    super("Model Builder");
    setType(Type.UTILITY);
    setAutoRequestFocus(false);
    // Make the x button do the same as the close button
    setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
    addWindowListener(FrameBox.getCloseListener("ShowModelBuilder"));

    tree = new MyTree();
    tree.setRootVisible(false);
    tree.setShowsRootHandles(true);
    DragSource dragSource = new DragSource();
    dragSource.createDefaultDragGestureRecognizer(tree, DnDConstants.ACTION_COPY, this);

    top = new DefaultMutableTreeNode();
    treeModel = new DefaultTreeModel(top);
    tree.setModel(treeModel);
    tree.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);

    // Create the tree scroll pane and add the tree to it
    treeView = new JScrollPane(tree);
    getContentPane().add(treeView);

    tree.setRowHeight(25);
    tree.setCellRenderer(new TreeCellRenderer());
    ToolTipManager.sharedInstance().registerComponent(tree);
    ToolTipManager.sharedInstance().setDismissDelay(600000);

    setLocation(GUIFrame.COL1_START, GUIFrame.TOP_START);
    setSize(GUIFrame.COL1_WIDTH, GUIFrame.HALF_TOP);
  }
예제 #2
0
 /** The constructor for the project selection frame. */
 public ProjectSelector() {
   super("Select a Project");
   GuiHelper.setWindowIcon(this);
   // show all the tooltips for 15000 mili-seconds
   defaultTooltipDismissDelay = ToolTipManager.sharedInstance().getDismissDelay();
   ToolTipManager.sharedInstance().setDismissDelay(myTooltipDismissDelay);
 }
 private void processEnabled() {
   if (myIsEnabled.asBoolean()) {
     ToolTipManager.sharedInstance().setEnabled(false);
   } else {
     ToolTipManager.sharedInstance().setEnabled(true);
   }
 }
  /** Creates a new global controller which creates others global controllers. */
  public GlobalController() {
    this.isletSelectionController = new IsletSelectionController(this);

    // For tooltips not be hidden by Canvas 3d
    ToolTipManager ttManager = ToolTipManager.sharedInstance();
    ttManager.setEnabled(true);
    ttManager.setLightWeightPopupEnabled(false);
  }
예제 #5
0
  /**
   * Initializes the AROUIManager with the styles that form the default the look and feel of the ARO
   * Data Analyzer.
   */
  public static void init() {
    put(TITLE_FONT_KEY, new Font(TITLE_FONT_KEY, Font.BOLD, 18));
    put(PAGE_BACKGROUND_KEY, Color.WHITE);
    put(LABEL_FONT_KEY, LABEL_FONT);

    /* Tool tip visibility delay configured. */
    ToolTipManager ttm = ToolTipManager.sharedInstance();
    ttm.setDismissDelay(8000);
  }
 /**
  * Toggles whether tool tips should be displayed showing the contents of collapsed fold regions
  * when the mouse hovers over a +/- icon.
  *
  * @param show Whether to show these tool tips.
  * @see #getShowCollapsedRegionToolTips()
  */
 public void setShowCollapsedRegionToolTips(boolean show) {
   if (show != showFoldRegionTips) {
     if (show) {
       ToolTipManager.sharedInstance().registerComponent(this);
     } else {
       ToolTipManager.sharedInstance().unregisterComponent(this);
     }
     showFoldRegionTips = show;
   }
 }
 private static JTree createTree() {
   JTree resultsTree = new JTree();
   resultsTree.setName("TREEVIEW");
   resultsTree.setRootVisible(false);
   resultsTree.setEditable(false);
   resultsTree.setShowsRootHandles(true);
   resultsTree.setCellRenderer(new FailureCellRenderer());
   ToolTipManager tipManager = ToolTipManager.sharedInstance();
   tipManager.registerComponent(resultsTree);
   resultsTree.addKeyListener(new EnterPressListener());
   return resultsTree;
 }
  /**
   * Initializes custom contact action buttons.
   *
   * @param contactActionButtons the list of buttons to initialize
   * @param gridX the X grid of the first button
   * @param xBounds the x bounds of the first button
   * @return the new grid X coordinate after adding all the buttons
   */
  private int initGroupActionButtons(
      Collection<SIPCommButton> contactActionButtons, int gridX, int xBounds) {
    // Reinit the labels to take the whole horizontal space.
    addLabels(gridX + contactActionButtons.size());

    Iterator<SIPCommButton> actionsIter = contactActionButtons.iterator();
    while (actionsIter.hasNext()) {
      final SIPCommButton actionButton = actionsIter.next();

      // We need to explicitly remove the buttons from the tooltip manager,
      // because we're going to manager the tooltip ourselves in the
      // DefaultTreeContactList class. We need to do this in order to have
      // a different tooltip for every button and for non button area.
      ToolTipManager.sharedInstance().unregisterComponent(actionButton);

      if (customActionButtonsUIGroup == null)
        customActionButtonsUIGroup = new LinkedList<JButton>();

      customActionButtonsUIGroup.add(actionButton);

      xBounds += addButton(actionButton, ++gridX, xBounds, false);
    }

    return gridX;
  }
예제 #9
0
  /**
   * This class requires a controller to which the ui can pass the abort commands, or other such
   * commands. It will not run without one.
   *
   * <p>However, instantiating without a controller should be fine, so long as a controller is set
   * before any updates.
   *
   * @param controller
   * @param model
   */
  public AtlasProgressFrame(IAtlasCreationController controller, AtlasProgressMonitorModel model) {
    super("Atlas creation in progress");
    this.model = model;
    this.downloadController = controller;
    ToolTipManager.sharedInstance().setDismissDelay(12000);
    if (MainGUI.getMainGUI()
        == null) // Atlas creation started via command-line, no MainGUi available
    setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    else setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);

    setIconImages(MainGUI.MOBAC_ICONS);
    setLayout(new GridBagLayout());
    updateTask = new UpdateTask();
    guiUpdater = new GUIUpdater(model);

    createComponents();
    // Initialize the layout in respect to the layout (font size ...)
    pack();

    guiUpdater.run();

    // The layout is now initialized - we disable it because we don't want
    // want to the labels to jump around if the content changes.
    background.setLayout(null);
    setResizable(false);

    Dimension dScreen = Toolkit.getDefaultToolkit().getScreenSize();
    Dimension dContent = getSize();
    setLocation((dScreen.width - dContent.width) / 2, (dScreen.height - dContent.height) / 2);

    initialTotalTime = System.currentTimeMillis();
    initialMapDownloadTime = System.currentTimeMillis();

    addWindowListener(new CloseListener());
  }
예제 #10
0
파일: Main.java 프로젝트: Rupsbant/swop
 public void init(BaseGUI gui) throws Exception {
   this.gui = gui;
   Config.loadConfig(); // only load config after gui is set (because of homepath)
   ToolTipManager.sharedInstance()
       .setDismissDelay(Integer.MAX_VALUE); // Tooltips should not hide after some time
   gui.initGUI(); // show gui
 }
  /**
   * Constructor.
   *
   * @param app The GUI application.
   */
  public HeapIndicatorPlugin(AbstractPluggableGUIApplication app) {

    msg = ResourceBundle.getBundle(BUNDLE_NAME);

    HeapIndicatorPrefs prefs = loadPrefs();

    this.app = app;
    heapIcon = new HeapIcon(this);
    setLayout(new BorderLayout());
    setBorder(BorderFactory.createEmptyBorder(2, 2, 4, 2));
    add(new JLabel(heapIcon));

    setUseSystemColors(prefs.useSystemColors);
    setIconForeground(prefs.iconForeground);
    setIconBorderColor(prefs.iconBorderColor);
    setVisible(prefs.visible);

    getData();
    setRefreshInterval(prefs.refreshInterval); // Must be called!

    ToolTipManager.sharedInstance().registerComponent(this);

    try {
      URL res = getClass().getResource("indicator.png");
      pluginIcon = new ImageIcon(ImageIO.read(res));
    } catch (IOException ioe) { // Never happens
      app.displayException(ioe);
    }
  }
예제 #12
0
  /** Creates a new repaint manager. This should be not be called directly. */
  public TextAreaPainter(JEditTextArea textArea, TextAreaDefaults defaults) {
    this.textArea = textArea;

    setAutoscrolls(true);
    setDoubleBuffered(true);
    setOpaque(true);

    ToolTipManager.sharedInstance().registerComponent(this);

    currentLine = new Segment();
    currentLineIndex = -1;

    setCursor(Cursor.getPredefinedCursor(Cursor.TEXT_CURSOR));

    setFont(new Font("Monospaced", Font.PLAIN, 14));
    setForeground(Color.black);
    setBackground(Color.white);

    blockCaret = defaults.blockCaret;
    styles = defaults.styles;
    cols = defaults.cols;
    rows = defaults.rows;
    caretColor = defaults.caretColor;
    selectionColor = defaults.selectionColor;
    lineHighlightColor = defaults.lineHighlightColor;
    lineHighlight = defaults.lineHighlight;
    bracketHighlightColor = defaults.bracketHighlightColor;
    bracketHighlight = defaults.bracketHighlight;
    paintInvalid = defaults.paintInvalid;
    eolMarkerColor = defaults.eolMarkerColor;
    eolMarkers = defaults.eolMarkers;
  }
예제 #13
0
  public TriggersTree(TriggersConfigurationDialog tcd) {
    super(new GridLayout(1, 0));

    this.tcd = tcd;

    rootNode = new DefaultMutableTreeNode("Root Node");
    treeModel = new DefaultTreeModel(rootNode);

    tree = new JTree(treeModel);
    treeRender = new TriggersTreeRender();
    treeCellEditor = new TriggersTreeCellEditor(tree, treeRender);

    tree.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);
    tree.setShowsRootHandles(false);
    tree.setRootVisible(false);
    tree.setDragEnabled(true);
    tree.setEditable(true);
    tree.addTreeSelectionListener(this);
    tree.setCellEditor(treeCellEditor);

    ToolTipManager.sharedInstance().registerComponent(tree);
    tree.setCellRenderer(treeRender);

    JScrollPane scrollPane = new JScrollPane(tree);
    add(scrollPane);

    reload();

    for (Trigger trigger : Main.getTriggerManager().getTriggers()) {
      setSelectedTrigger(trigger);
      return;
    }
  }
 /**
  * Allocates a new {@link StyledParserEditor} instance.
  *
  * @see JEditorPane#JEditorPane()
  */
 public StyledParserEditor() {
   super();
   this.noWrapStyledEditorKit = new NoWrapStyledEditorKit();
   setEditorKit(this.noWrapStyledEditorKit);
   setBorder(new EmptyBorder(2, 2, 2, 2));
   ToolTipManager.sharedInstance().registerComponent(this);
 }
예제 #15
0
  /** Creates a new repaint manager. This should be not be called directly. */
  public TextAreaPainter(JEditTextArea textArea, TextAreaDefaults defaults) {
    this.textArea = textArea;

    setAutoscrolls(true);
    setDoubleBuffered(true);
    setOpaque(true);

    ToolTipManager.sharedInstance().registerComponent(this);

    currentLine = new Segment();
    currentLineIndex = -1;

    setCursor(Cursor.getPredefinedCursor(Cursor.TEXT_CURSOR));

    // unfortunately probably can't just do setDefaults() since things aren't quite set up
    setFont(defaults.font);
    setForeground(defaults.fgcolor);
    setBackground(defaults.bgcolor);

    blockCaret = defaults.blockCaret;
    styles = defaults.styles;
    caretColor = defaults.caretColor;
    selectionColor = defaults.selectionColor;
    lineHighlightColor = defaults.lineHighlightColor;
    lineHighlight = defaults.lineHighlight;
    bracketHighlightColor = defaults.bracketHighlightColor;
    bracketHighlight = defaults.bracketHighlight;
    eolMarkerColor = defaults.eolMarkerColor;
    eolMarkers = defaults.eolMarkers;
    antialias = defaults.antialias;

    cols = defaults.cols;
    rows = defaults.rows;
  }
예제 #16
0
 public FriendTree(LeftSidebar sb, RobonoboFrame frame) {
   super(new FriendTreeModel(frame), frame);
   this.sideBar = sb;
   getModel().setTree(this);
   normalFont = RoboFont.getFont(12, false);
   boldFont = RoboFont.getFont(12, true);
   setName("robonobo.playlist.tree");
   setAlignmentX(0.0f);
   setRootVisible(true);
   collapseRow(0);
   rootIcon = createImageIcon("/icon/friends.png");
   addFriendsIcon = createImageIcon("/icon/add_friends.png");
   friendIcon = createImageIcon("/icon/friend.png");
   playlistIcon = createImageIcon("/icon/playlist.png");
   libraryIcon = createImageIcon("/icon/home.png");
   // Special playlist icons
   specIcons.put("loves", createImageIcon("/icon/heart-small.png"));
   specIcons.put("radio", createImageIcon("/icon/radio-small.png"));
   setCellRenderer(new CellRenderer());
   setSelectionModel(new SelectionModel());
   getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);
   addTreeSelectionListener(new SelectionListener());
   // This is required for tooltips to work
   ToolTipManager.sharedInstance().registerComponent(this);
 }
예제 #17
0
  /**
   * Creates a new graph viewer, connected to the component given as argument. The viewer initially
   * displays an empty graph.
   *
   * @param tab the state viewer component
   */
  public StateViewer(StateViewerTab tab) {
    super(new StaticLayout<String, Integer>(new DelegateForest<String, Integer>()));
    this.tab = tab;

    // scaling it by 60%
    final ScalingControl scaler = new CrossoverScalingControl();
    scaler.scale(this, 0.7f, getCenter());

    // setting various renderers and element transformers
    setBackground(Color.white);
    getRenderContext().setVertexLabelTransformer(new ToStringLabeller<String>());
    getRenderContext().setVertexShapeTransformer(new CustomVertexShapeRenderer());
    getRenderContext().setVertexFillPaintTransformer(new CustomVertexColourRenderer());
    getRenderContext().setVertexLabelRenderer(new CustomVertexLabelRenderer());
    getRenderer().getVertexLabelRenderer().setPosition(Position.S);
    setVertexToolTipTransformer(new CustomToolTipTransformer());
    ToolTipManager.sharedInstance().setDismissDelay(1000000000);

    // connects the graph to a custom mouse listener (for selecting nodes)
    DefaultModalGraphMouse<String, Integer> graphMouse =
        new DefaultModalGraphMouse<String, Integer>();
    graphMouse.setMode(Mode.PICKING);

    graphMouse.add(new PopupHandler(this));
    setGraphMouse(graphMouse);

    shownDistribs = new HashMap<String, DistributionViewer>();
  }
예제 #18
0
  public static void configureLookAndFeel() {
    try {

      Properties props = new Properties();

      props.setProperty("controlTextFont", "Dialog 10");
      props.setProperty("systemTextFont", "Dialog 10");
      props.setProperty("userTextFont", "Dialog 10");
      props.setProperty("menuTextFont", "Dialog 10");
      props.setProperty("windowTitleFont", "Dialog bold 10");
      props.setProperty("subTextFont", "Dialog 8");

      props.put("logoString", "Herobrine");
      props.put("textAntiAliasing", "on");

      com.jtattoo.plaf.acryl.AcrylLookAndFeel.setCurrentTheme(props);
      UIManager.setLookAndFeel("com.jtattoo.plaf.acryl.AcrylLookAndFeel");

      // Fix Leightweight component render issues
      JPopupMenu.setDefaultLightWeightPopupEnabled(false);
      ToolTipManager.sharedInstance().setLightWeightPopupEnabled(false);
    } catch (Exception e) {
      e.printStackTrace();
    }
  }
예제 #19
0
  public JSMAAMainFrame(SMAAModel model) {
    super(AppInfo.getAppName());

    ChartFactory.setChartTheme(StandardChartTheme.createLegacyTheme());
    ToolTipManager.sharedInstance().setInitialDelay(0);
    setPreferredSize(new Dimension(950, 700));
    setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);

    modelManager = new ModelFileManager();
    modelManager.addPropertyChangeListener(
        ModelFileManager.PROPERTY_TITLE,
        new PropertyChangeListener() {
          @Override
          public void propertyChange(PropertyChangeEvent ev) {
            setTitle((String) ev.getNewValue());
          }
        });
    modelManager.addPropertyChangeListener(
        ModelFileManager.PROPERTY_MODEL,
        new PropertyChangeListener() {
          @Override
          public void propertyChange(PropertyChangeEvent evt) {
            initWithModel((SMAAModel) evt.getNewValue());
          }
        });
    modelManager.setModel(model);
  }
예제 #20
0
  private JLabel getComparedLabel(Object value, String metrics) {
    try {
      final CompareInfo info =
          AdjustHistory.getInstance()
              .compare(
                  new CompareObject(value, null, metrics) {
                    @Override
                    public Object getOriginalityValue(AnalysisResult result) {
                      if (this.getMetrics().equals(AnalysisResult.Metrics_TotalScore)) {
                        return result.getScore();
                      } else if (this.getMetrics().equals(AnalysisResult.Metrics_D)) {
                        return result.getDistance();
                      } else if (this.getMetrics().equals(AnalysisResult.Metrics_Balance)) {
                        return result.getBalance();
                      } else if (this.getMetrics()
                          .equals(AnalysisResult.Metrics_RelationRationality)) {
                        return result.getRelationRationality();
                      } else if (this.getMetrics().equals(AnalysisResult.Metrics_Encapsulation)) {
                        return result.getEncapsulation();
                      } else if (this.getMetrics().equals(AnalysisResult.Metrics_LC)) {
                        return result.getSummary().getLineCount();
                      } else if (this.getMetrics().equals(AnalysisResult.Metrics_CN)) {
                        return result.getSummary().getClassCount();
                      } else if (this.getMetrics().equals(AnalysisResult.Metrics_ComponentCount)) {
                        return result.getComponents().size();
                      } else if (this.getMetrics().equals(AnalysisResult.Metrics_RelationCount)) {
                        return result.getRelations().size();
                      } else if (this.getMetrics()
                          .equals(AnalysisResult.Metrics_RelationComponentScale)) {
                        return result.calRelationComponentScale();
                      } else if (this.getMetrics().equals(AnalysisResult.Metrics_Coupling)) {
                        return result.getSummary().getCoupling();
                      } else if (this.getMetrics().equals(AnalysisResult.Metrics_Cohesion)) {
                        return result.getSummary().getCohesion();
                      }
                      return null;
                    }
                  });

      if (info != null && info.isDiff()) {
        JLabel labelDirection =
            new JLabel() {
              @Override
              public String getToolTipText(MouseEvent e) {
                return "Originality:" + info.getOriginality();
              }
            };
        ToolTipManager.sharedInstance().registerComponent(labelDirection);
        CompareInfoWebWarpper warpper = new CompareInfoWebWarpper(info);
        labelDirection.setText(warpper.getCompare());
        labelDirection.setForeground(warpper.getDirectionColor());
        return labelDirection;
      } else {
        return null;
      }
    } catch (JDependException e1) {
      e1.printStackTrace();
      return null;
    }
  }
  public BulkDownloadPanel(WorldWindow wwd) {
    this.wwd = wwd;

    // Init retievable list
    this.retrievables = new ArrayList<BulkRetrievablePanel>();
    // Layers
    for (Layer layer : this.wwd.getModel().getLayers()) {
      if (layer instanceof BulkRetrievable)
        this.retrievables.add(new BulkRetrievablePanel((BulkRetrievable) layer));
    }
    // Elevation models
    CompoundElevationModel cem =
        (CompoundElevationModel) wwd.getModel().getGlobe().getElevationModel();
    for (ElevationModel elevationModel : cem.getElevationModels()) {
      if (elevationModel instanceof BulkRetrievable)
        this.retrievables.add(new BulkRetrievablePanel((BulkRetrievable) elevationModel));
    }

    // Init sector selector
    this.selector = new SectorSelector(wwd);
    this.selector.setInteriorColor(new Color(1f, 1f, 1f, 0.1f));
    this.selector.setBorderColor(new Color(1f, 0f, 0f, 0.5f));
    this.selector.setBorderWidth(3);
    this.selector.addPropertyChangeListener(
        SectorSelector.SECTOR_PROPERTY,
        new PropertyChangeListener() {
          public void propertyChange(PropertyChangeEvent evt) {
            updateSector();
          }
        });

    JPopupMenu.setDefaultLightWeightPopupEnabled(false);
    ToolTipManager.sharedInstance().setLightWeightPopupEnabled(false);
    this.initComponents();
  }
예제 #22
0
 public MagicGlassPane() {
   super(null);
   setOpaque(false);
   enableEvents(AWTEvent.MOUSE_EVENT_MASK);
   enableEvents(AWTEvent.MOUSE_MOTION_EVENT_MASK);
   enableEvents(AWTEvent.MOUSE_WHEEL_EVENT_MASK);
   ToolTipManager.sharedInstance().registerComponent(this);
 }
예제 #23
0
 private JVSStartPanel(JPanel panel) {
   super(
       panel,
       JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
       JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
   setMinimumSize(new Dimension(800, 600));
   ToolTipManager.sharedInstance().setInitialDelay(75);
 }
예제 #24
0
 @Override
 public void actionPerformed(ActionEvent e) {
   Object value = e.getSource();
   getContentPane().setValue(value);
   getContentPane().setVisible(false);
   // ExportDialog.this.dialog.setVisible(false);
   ToolTipManager.sharedInstance().registerComponent(SaveLTSAsDialog.this.pane);
 }
예제 #25
0
  /**
   * Layout the GUI components for this RootFolder with an expandable JTree on the left of a
   * SplitPane and the main panel on the right.
   */
  private void layoutWithFolderTree() {

    // get the JTree Component
    tree = getFolderTree();

    if (rootIsVisible == false) // hide the root node
    {
      tree.setRootVisible(false);
    }

    // Enable tool tips.
    ToolTipManager.sharedInstance().registerComponent(tree);

    // embed the JTree in a scrollpane
    JScrollPane treeScrollPane = new JScrollPane(tree);

    // the left and right sides of the JSplitPane
    JComponent leftside, rightside = mainPanel;

    if (globalParams == null && buttonPanel == null) {
      // Create a split pane with the treePane on the left and the main panel on the right
      leftside = treeScrollPane;
    } else {
      /* the left side has global parameters and/or buttons so we need to create a
       * vertical split pane for the tree and the parameters/buttons
       */
      JComponent globalParamsBox = globalParams;

      // globalparams could be null but buttonpanel could not be
      if (buttonPanel != null) {
        // add buttonPanel to a vertical box with globalParams
        Box box = Box.createVerticalBox();

        if (globalParams != null) {
          box.add(globalParams);
          box.add(Box.createVerticalGlue());
        }
        box.add(buttonPanel);

        globalParamsBox = box;
      }

      // create the vertical split pane
      leftside =
          new JSplitPane(
              JSplitPane.VERTICAL_SPLIT, treeScrollPane, new JScrollPane(globalParamsBox));
    }

    // create the horizontal split pane with the left and right sides
    JSplitPane splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, leftside, rightside);
    splitPane.setOneTouchExpandable(true);

    // set the divider location to be 150 pixels from the left
    splitPane.setDividerLocation(150);

    // add the split pane to this component
    add(splitPane, BorderLayout.CENTER);
  }
  static {
    // Put JOGL version information into system properties to
    // assist in debugging.
    Package joglPackage = Package.getPackage("javax.media.opengl");
    System.setProperty("jogl.specification.version", joglPackage.getSpecificationVersion());
    System.setProperty("jogl.implementation.version", joglPackage.getImplementationVersion());

    ToolTipManager.sharedInstance().setLightWeightPopupEnabled(false);
  }
예제 #27
0
  public void showResults(Container parent, String title) {
    Container realparent = null;

    if (parent instanceof JComponent) realparent = ((JComponent) parent).getTopLevelAncestor();
    else if (parent instanceof Window) realparent = parent;

    if (realparent instanceof Dialog) win = new JraDialog((Dialog) realparent, title, true);
    else if (realparent instanceof Frame) win = new JraDialog((Frame) realparent, title, true);
    else win = new JraDialog((Frame) null, title, true);
    win.setContentPane(contents);
    ((MatchTableModel) table.getModel()).fillData(master);
    win.pack();
    win.setLocationRelativeTo(parent);
    win.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
    win.addWindowListener(
        new WindowAdapter() {
          public void windowClosing(WindowEvent e) {
            CancelPress();
          }
        });
    win.addKeyListener(
        new KeyAdapter() {
          public void keyTyped(KeyEvent e) {
            if (e.getKeyChar() == e.VK_ESCAPE) {
              CancelPress();
              e.consume();
            }
          }

          public void keyPressed(KeyEvent e) {
            if (e.getKeyCode() == e.VK_A && e.getModifiers() == e.CTRL_MASK) {
              ((Action) table.getActionMap().get("selectAll")).actionPerformed(null);
              e.consume();
            }
          }
        });
    int dd = ToolTipManager.sharedInstance().getDismissDelay();
    ToolTipManager.sharedInstance().setDismissDelay(10000);
    okp.registerOKPanelKeys(win);
    table.scrollRectToVisible(new Rectangle(0, 0, 10, 10));
    if (table.isEditing()) table.removeEditor();
    win.show();
    ToolTipManager.sharedInstance().setDismissDelay(dd);
  }
  @Override
  public void dispose() {
    if (myUsagePreviewPanel != null) {
      UsageViewSettings.getInstance().PREVIEW_USAGES_SPLITTER_PROPORTIONS =
          ((Splitter) myUsagePreviewPanel.getParent()).getProportion();
      myUsagePreviewPanel = null;
    }

    isDisposed = true;
    ToolTipManager.sharedInstance().unregisterComponent(myTree);
  }
  /** Add tooltips for all elements of the window */
  private void addTooltips() {

    extractAllRegulators_.setToolTipText(
        "<html>Extract all regulators of the network, i.e., all nodes that have at least<br>"
            + "one outgoing link <i>in the source network</i>. E.g., if the source network is<br>"
            + "<i>Ecoli</i>, the extracted subnetwork would consist of all <i>E.coli</i> transcription factors.</html>");
    useNumRegulators_.setToolTipText(
        "<html>Select to specify the minimum number of regulators (nodes with at least one outgoing<br>"
            + "link <i>in the source network</i>) that should be included in the extracted subnetworks</html>");
    numRegulators_.setToolTipText(
        "<html>The minimum number of regulators (nodes with at least one outgoing link<br>"
            + "<i>in the source network</i>) to be included in the extracted subnetworks</html>");
    randomVertex_.setToolTipText(
        "<html>Randomly choose a seed node to<br>" + "start subnetwork extraction</html>");
    selectionFromList_.setToolTipText(
        "<html>Manually select a seed node to<br>" + "start subnetwork extraction</html>");
    greedy_.setToolTipText(
        "<html>When growing the subnetwork, always add<br>"
            + "nodes that lead to the highest modularity <i>Q</i></html>");
    randomAmongTop_.setToolTipText(
        "<html>When growing the subnetwork, add nodes from the top <i>k</i> percent of highest modularity <i>Q</i>.<br>"
            + "Set to 100% for random subnetwork extraction (add random neighboring nodes). Setting this<br>"
            + "parameter to 0% is equivalent to selecting the greedy strategy above.</html>");
    stronglyConnected_.setToolTipText(
        "<html>Add the specified number of nodes from the largest strongly connected component of the<br>"
            + "graph as seeds. <b>Warning</b>: this works fine if the network has a single strongly connected component,<br>"
            + "as <i>Yeast</i> does. However, if there are several stongly connected components, the smaller ones will<br>"
            + "never be sampled (to be corrected in the next version).</html>");
    numStronglyConnected_.setToolTipText(
        "<html>The number of nodes to be added as seed nodes<br>"
            + "from the largest strongly connected component</html>");
    subnetRootName_.setToolTipText(
        "<html>Specify a name for the subnetwork. If several subnetworks<br>"
            + "are being extracted, they will be named as follows:<br>"
            + "- <i>name</i>-1<br>"
            + "- <i>name</i>-2<br>"
            + "- etc.</html>");
    subnetSize_.setToolTipText("<html>Extract subnetworks of the given size</html>");
    numberSubnets_.setToolTipText("<html>Number of subnetworks to be extracted</html>");
    listVerticesID_.setToolTipText(
        "<html>Select a seed node to<br>" + "start subnetwork extraction</html>");
    randomAmongTopSpinner_.setToolTipText(
        "<html>When growing the subnetwork, add nodes from the top <i>k</i> percent of highest modularity <i>Q</i>.<br>"
            + "Set to 100% for random subnetwork extraction (add random neighboring nodes). Setting this<br>"
            + "parameter to 0% is equivalent to selecting the greedy strategy above.</html>");
    runButton_.setToolTipText(
        "<html>Set parameters to the given values<br>" + "and start subnetwork extraction</html>");
    cancelButton.setToolTipText(
        "<html>Abort (the thread may finish the<br>"
            + "current subnetwork before it exits)</html>");

    // tooltips disappear only after 10s
    ToolTipManager.sharedInstance().setDismissDelay(10000);
  }
예제 #30
0
  public IvusFrame(World world) {
    OrbitView view = (world != null) ? new OrbitView(world) : new OrbitView();
    view.setAxesOrientation(AxesOrientation.XRIGHT_YOUT_ZDOWN);
    ViewCanvas canvas = new ViewCanvas(view);
    canvas.setView(view);

    ModeManager mm = new ModeManager();
    mm.add(canvas);
    OrbitViewMode ovm = new OrbitViewMode(mm);
    SelectDragMode sdm = new SelectDragMode(mm);

    JPopupMenu.setDefaultLightWeightPopupEnabled(false);
    ToolTipManager.sharedInstance().setLightWeightPopupEnabled(false);

    JMenu fileMenu = new JMenu("File");
    fileMenu.setMnemonic('F');
    Action exitAction =
        new AbstractAction("Exit") {
          private static final long serialVersionUID = 1L;

          public void actionPerformed(ActionEvent event) {
            System.exit(0);
          }
        };
    JMenuItem exitItem = fileMenu.add(exitAction);
    exitItem.setMnemonic('x');

    JMenu modeMenu = new JMenu("Mode");
    modeMenu.setMnemonic('M');
    JMenuItem ovmItem = new ModeMenuItem(ovm);
    modeMenu.add(ovmItem);
    JMenuItem sdmItem = new ModeMenuItem(sdm);
    modeMenu.add(sdmItem);

    JMenuBar menuBar = new JMenuBar();
    menuBar.add(fileMenu);
    menuBar.add(modeMenu);

    JToolBar toolBar = new JToolBar(SwingConstants.VERTICAL);
    toolBar.setRollover(true);
    JToggleButton ovmButton = new ModeToggleButton(ovm);
    toolBar.add(ovmButton);
    JToggleButton sdmButton = new ModeToggleButton(sdm);
    toolBar.add(sdmButton);

    ovm.setActive(true);

    this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    this.setSize(new Dimension(SIZE, SIZE));
    this.add(canvas, BorderLayout.CENTER);
    this.add(toolBar, BorderLayout.WEST);
    this.setJMenuBar(menuBar);
  }