/// <summary> /// Constructor. </summary> /// <param name="annotationDataList"> list of annotation data, if available (can pass null and reset the list /// later by calling setAnnotationData()). </param> /// <param name="hideIfEmpty"> if true, set the panel to not visible if the list is empty - this may be appropriate /// if UI real estate is in short supply and annotations should only be shown if used </param> public StateMod_Network_AnnotationDataListJPanel(IList <StateMod_Network_AnnotationData> annotationDataList, StateMod_Network_JComponent networkJComponent, bool hideIfEmpty) : base() { // Set up the layout manager this.setLayout(new GridBagLayout()); this.setBorder(BorderFactory.createTitledBorder("Annotations")); int y = 0; Insets insetsTLBR = new Insets(0, 0, 0, 0); __annotationJList = new JList(); if (annotationDataList != null) { setAnnotationData(annotationDataList); } JGUIUtil.addComponent(this, new JScrollPane(__annotationJList), 0, y, 1, 1, 1.0, 1.0, insetsTLBR, GridBagConstraints.BOTH, GridBagConstraints.SOUTH); __hideIfEmpty = hideIfEmpty; __networkJComponent = networkJComponent; // Add popup for actions on annotations //JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final': //ORIGINAL LINE: final javax.swing.JPopupMenu popupMenu = new javax.swing.JPopupMenu(); JPopupMenu popupMenu = new JPopupMenu(); JMenuItem removeAllAnnotationsJMenuItem = new JMenuItem(__RemoveAllAnnotationsString); removeAllAnnotationsJMenuItem.addActionListener(this); popupMenu.add(removeAllAnnotationsJMenuItem); __annotationJList.addMouseListener(new MouseAdapterAnonymousInnerClass(this, popupMenu)); checkVisibility(); }
/// <summary> /// Constructor. </summary> /// <param name="parent"> the JFrame on which this dialog will be shown. </param> /// <param name="ds"> the Downstream node from where the node should be added. </param> public StateMod_Network_AddLink_JDialog(StateMod_Network_JFrame parent, StateMod_Network_JComponent device, HydrologyNode[] nodes) : base(parent, "Add Link", true) { __parent = parent; __device = device; __nodes = nodes; setupGUI(); }
/// <summary> /// Constructor. </summary> /// <param name="parent"> the parent GUI that instantiated this GUI. </param> /// <param name="node"> the node for which to edit properties. </param> /// <param name="nodeNum"> the number of the node in the parent GUI. </param> public StateMod_Network_AnnotationProperties_JDialog(StateMod_Network_JComponent parent, bool editable, HydrologyNode node, int nodeNum) { __parent = parent; __editable = editable; __node = node; __nodeNum = nodeNum; JGUIUtil.setIcon(this, JGUIUtil.getIconImage()); setupGUI(); }
/// <summary> /// Constructor. The major objects used in editing are passed in, but may not be required for all actions. </summary> /// <param name="editorJFrame"> the controlling editor window (e.g., to allow popup dialogs to position) </param> /// <param name="editorComponent"> the graphical editor component that renders the network, which does some internal /// optimized data management </param> /// <param name="network"> the network that will be manipulated, although subsets of the network may be passed in to /// specific methods </param> public StateMod_Network_EditorToolkit(StateMod_Network_JFrame editorJFrame, StateMod_Network_JComponent editorJComponent, StateMod_NodeNetwork network) { this.__editorJFrame = editorJFrame; this.__editorJComponent = editorJComponent; this.__network = network; }
/// <summary> /// Set the GeoView that is rendering the map. /// </summary> public virtual void setNetworkJComponent(StateMod_Network_JComponent networkJComponent) { __networkJComponent = networkJComponent; }