/// <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();
        }
Exemple #2
0
        /// <summary>
        /// This method is called from within the constructor to initialize the form.
        /// WARNING: Do NOT modify this code. The content of this method is always
        /// regenerated by the Form Editor.
        /// </summary>
        // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
        private void initComponents()
        {
            jPopupMenu1     = new JPopupMenu();
            copyItem        = new JMenuItem();
            saveAsItem      = new JMenuItem();
            jSplitPane1     = new javax.swing.JSplitPane();
            jScrollPane1    = new javax.swing.JScrollPane();
            commandLogTable = new JTable();
            jScrollPane2    = new javax.swing.JScrollPane();
            fileHandleTable = new JTable();
            cbFileTrace     = new javax.swing.JCheckBox();

            copyItem.Accelerator = javax.swing.KeyStroke.getKeyStroke([email protected]_C, [email protected]_MASK);
            java.util.ResourceBundle bundle = java.util.ResourceBundle.getBundle("pspsharp/languages/pspsharp"); // NOI18N
            copyItem.Text = bundle.getString("FileLoggerFrame.copyItem.text");                                   // NOI18N
            copyItem.addActionListener(new ActionListenerAnonymousInnerClass(this));
            jPopupMenu1.add(copyItem);

            saveAsItem.Text = bundle.getString("FileLoggerFrame.saveAsItem.text");             // NOI18N
            saveAsItem.addActionListener(new ActionListenerAnonymousInnerClass2(this));
            jPopupMenu1.add(saveAsItem);

            DefaultCloseOperation = javax.swing.WindowConstants.DISPOSE_ON_CLOSE;
            Title       = bundle.getString("FileLoggerFrame.title");       // NOI18N
            MinimumSize = new java.awt.Dimension(400, 200);

            jSplitPane1.DividerLocation = 100;
            jSplitPane1.Orientation     = javax.swing.JSplitPane.VERTICAL_SPLIT;
            jSplitPane1.MinimumSize     = new java.awt.Dimension(179, 100);

            commandLogTable.Model             = fileCommandModel;
            commandLogTable.InheritsPopupMenu = true;
            commandLogTable.MinimumSize       = new java.awt.Dimension(200, 100);
            commandLogTable.Name = bundle.getString("FileLoggerFrame.commandLogTable.name");             // NOI18N
            commandLogTable.addMouseListener(new MouseAdapterAnonymousInnerClass(this));
            jScrollPane1.ViewportView = commandLogTable;

            jSplitPane1.BottomComponent = jScrollPane1;

            fileHandleTable.Model             = fileHandleModel;
            fileHandleTable.InheritsPopupMenu = true;
            fileHandleTable.MinimumSize       = new java.awt.Dimension(200, 100);
            fileHandleTable.Name = bundle.getString("FileLoggerFrame.fileHandleTable.name");             // NOI18N
            fileHandleTable.addMouseListener(new MouseAdapterAnonymousInnerClass2(this));
            jScrollPane2.ViewportView = fileHandleTable;

            jSplitPane1.TopComponent = jScrollPane2;

            cbFileTrace.Text = bundle.getString("FileLoggerFrame.cbFileTrace.text");             // NOI18N
            cbFileTrace.addActionListener(new ActionListenerAnonymousInnerClass3(this));

            javax.swing.GroupLayout layout = new javax.swing.GroupLayout(ContentPane);
            ContentPane.Layout     = layout;
            layout.HorizontalGroup = layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup(layout.createSequentialGroup().addContainerGap().addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup(layout.createSequentialGroup().addComponent(cbFileTrace).addGap(0, 0, short.MaxValue)).addComponent(jSplitPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 628, short.MaxValue)).addContainerGap());
            layout.VerticalGroup   = layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup().addContainerGap().addComponent(cbFileTrace).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).addComponent(jSplitPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 257, short.MaxValue).addContainerGap());

            pack();
        }         // </editor-fold>//GEN-END:initComponents
 /// <summary>
 /// Construct a StateCU_DataSet_JFrame.  The data set should be set when available
 /// using setDataSet(). </summary>
 /// <param name="parent"> JFrame from which this instance is constructed. </param>
 /// <param name="display_data_objects"> If true, data objects are listed in the tree.  If
 /// false, only the top-level data set components are listed. </param>
 public StateCU_DataSet_JTree(JFrame parent, bool display_data_objects)
 {
     __display_data_objects = display_data_objects;
     __folderIcon           = getClosedIcon();
     showRootHandles(true);
     addMouseListener(this);
     setLeafIcon(null);
     setTreeTextEditable(false);
     __popup_JPopupMenu = new JPopupMenu();
 }
        /// <summary>
        /// Construct a StateMod_DataSet_JFrame. </summary>
        /// <param name="parent"> JFrame from which this instance is constructed. </param>
        /// <param name="dataset"> StateMod_DataSet that is being displayed/managed. </param>
        /// <param name="dataset_wm"> the dataset window manager or null if the data set windows are not being managed. </param>
        /// <param name="display_data_objects"> If true, data objects are listed in the tree.  If </param>
        /// <param name="editable"> If true, data objects can be edited.
        /// false, only the top-level data set components are listed. </param>
        public StateMod_DataSet_JTree(JFrame parent, StateMod_DataSet dataset, StateMod_DataSet_WindowManager dataset_wm, bool display_data_objects, bool editable)
        {
            __dataset              = dataset;
            __dataset_wm           = dataset_wm;
            __display_data_objects = display_data_objects;
            __editable             = editable;

            __folderIcon = getClosedIcon();

            showRootHandles(true);
            addMouseListener(this);
            setLeafIcon(null);
            setTreeTextEditable(false);
            __popup_JPopupMenu = new JPopupMenu();
        }
Exemple #5
0
        public JNode GetNode(DataRow pRow)
        {
            JNode      Node         = new JNode((int)pRow["Code"], "BusManagment.UserDynamicDashboard.JUserDynamicDashboard");
            JPopupMenu pMenu        = new JPopupMenu("BusManagment.Bus.JBuses", Node.Code);
            JAction    deleteAction = new JAction("delete...", "BusManagment.UserDynamicDashboard.JUserDynamicDashboard.Delete", null, new object[] { (int)pRow["Code"] });
            JAction    editAction   = new JAction("Edit...", "BusManagment.UserDynamicDashboard.JUserDynamicDashboardForm.ShowDialog", null, new object[] { (int)pRow["Code"] });
            JAction    newAction    = new JAction("new...", "BusManagment.UserDynamicDashboard.JUserDynamicDashboardForm.ShowDialog", null, null);

            pMenu.Insert(deleteAction);
            pMenu.Insert(editAction);
            pMenu.Insert(newAction);

            Node.Popup = pMenu;
            Node.MouseDBClickAction = editAction;
            return(Node);
        }
Exemple #6
0
        public JNode GetNode(DataRow pRow)
        {
            JNode Node = new JNode((int)pRow["Code"], "BusManagment.Station.JStation");

            Node.MouseDBClickAction = new JAction("EditStation", "BusManagment.Station.JStationForm.ShowDialog", null, new object[] { (int)pRow["Code"] });

            int        code         = (int)pRow["Code"];
            JPopupMenu pMenu        = new JPopupMenu("BusManagment.Bus.JBuses", Node.Code);
            JAction    deleteAction = new JAction("delete...", "BusManagment.Station.JStationForm.Delete", null, new object[] { code });
            JAction    editAction   = new JAction("Edit...", "BusManagment.Station.JStationForm.ShowDialog", null, new object[] { code });
            JAction    newAction    = new JAction("new...", "BusManagment.Station.JStationForm.ShowDialog", null, null);

            pMenu.Insert(deleteAction);
            pMenu.Insert(editAction);
            pMenu.Insert(newAction);

            Node.Popup = pMenu;
            return(Node);

            //AUTOMOBILE.Automobile.JAutomobileForm AForm = new Automobile.JAutomobileForm((int)pRow["Code"]);
            //AForm.ShowDialog();
            //return null;
        }
 /// <summary>
 /// Returns the <code>Popup</code> that will be responsible for
 /// displaying the <code>JPopupMenu</code>.
 /// </summary>
 public Popup getPopup(JPopupMenu @popup, int @x, int @y)
 {
     return(default(Popup));
 }
Exemple #8
0
        protected internal virtual void syncRibbonState()
        {
            BasicRibbonUI.BandHostPanel bandHostPanel = (BasicRibbonUI.BandHostPanel) this.bandScrollablePanel.View;
            bandHostPanel.removeAll();
            BasicRibbonUI.TaskToggleButtonsHostPanel taskToggleButtonsHostPanel = (BasicRibbonUI.TaskToggleButtonsHostPanel) this.taskToggleButtonsScrollablePanel.View;
            taskToggleButtonsHostPanel.removeAll();
            if (this.o_searchButton != null)
            {
                this.ribbon.remove(this.o_searchButton);
                this.o_searchButton = null;
            }
            if (this.o_trailingButton != null)
            {
                this.ribbon.remove(this.o_trailingButton);
                this.o_trailingButton = null;
            }
            if (this.closeButton != null)
            {
                this.ribbon.remove(this.closeButton);
                this.closeButton = null;
            }
            if (this.helpButton != null)
            {
                this.ribbon.remove(this.helpButton);
                this.helpButton = null;
            }
            System.Collections.IList list = CurrentlyShownRibbonTasks;
            RibbonTask ribbonTask         = this.ribbon.SelectedTask;

            foreach (RibbonTask ribbonTask1 in list)
            {
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final org.pushingpixels.flamingo.internal.ui.ribbon.JRibbonTaskToggleButton taskToggleButton = new org.pushingpixels.flamingo.internal.ui.ribbon.JRibbonTaskToggleButton(ribbonTask1);
                JRibbonTaskToggleButton taskToggleButton = new JRibbonTaskToggleButton(ribbonTask1);
                jRibbonTaskToggleButton1.KeyTip = ribbonTask1.KeyTip;
                jRibbonTaskToggleButton1.addActionListener(new ActionListenerAnonymousInnerClass(this, list, taskToggleButton));
                jRibbonTaskToggleButton1.addMouseListener(new MouseAdapterAnonymousInnerClass(this));
                if (ribbonTask1.ContextualGroup != null)
                {
                    jRibbonTaskToggleButton1.ContextualGroupHueColor = ribbonTask1.ContextualGroup.HueColor;
                }
                jRibbonTaskToggleButton1.putClientProperty("flamingo.internal.commandButton.ui.dontDisposePopups", true);
                this.taskToggleButtonGroup.add(jRibbonTaskToggleButton1);
                taskToggleButtonsHostPanel.add(jRibbonTaskToggleButton1);
                this.taskToggleButtons.put(ribbonTask1, jRibbonTaskToggleButton1);
            }
            JRibbonTaskToggleButton jRibbonTaskToggleButton = (JRibbonTaskToggleButton)this.taskToggleButtons.get(ribbonTask);

            if (jRibbonTaskToggleButton != null)
            {
                jRibbonTaskToggleButton.ActionModel.Selected = true;
            }
            sbyte b;

            for (b = 0; b < this.ribbon.TaskCount; b++)
            {
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final org.pushingpixels.flamingo.api.ribbon.RibbonTask task = this.ribbon.getTask(b);
                RibbonTask task = this.ribbon.getTask(b);
                foreach (AbstractRibbonBand abstractRibbonBand in ribbonTask1.Bands)
                {
                    bandHostPanel.add(abstractRibbonBand);
                    abstractRibbonBand.Visible = (ribbonTask == ribbonTask1);
                }
            }
            for (b = 0; b < this.ribbon.ContextualTaskGroupCount; b++)
            {
                RibbonContextualTaskGroup ribbonContextualTaskGroup = this.ribbon.getContextualTaskGroup(b);
                for (sbyte b1 = 0; b1 < ribbonContextualTaskGroup.TaskCount; b1++)
                {
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final org.pushingpixels.flamingo.api.ribbon.RibbonTask task = ribbonContextualTaskGroup.getTask(b1);
                    RibbonTask task = ribbonContextualTaskGroup.getTask(b1);
                    foreach (AbstractRibbonBand abstractRibbonBand in ribbonTask1.Bands)
                    {
                        bandHostPanel.add(abstractRibbonBand);
                        abstractRibbonBand.Visible = (ribbonTask == ribbonTask1);
                    }
                }
            }
            ActionListener actionListener1 = ((BaseRibbon)this.ribbon).UserNameActionListener;

            if (actionListener1 != null && DatabaseDBUtil.Enterprise)
            {
                this.o_trailingButton = new UISplitButton("");
                if (DatabaseDBUtil.Loaded)
                {
                    ((UISplitButton)this.o_trailingButton).Text = DatabaseDBUtil.Properties.UserAndRolesData.PrincipalsData.Name;
                    ((UISplitButton)this.o_trailingButton).VerticalTextPosition   = 0;
                    ((UISplitButton)this.o_trailingButton).HorizontalTextPosition = 2;
                    loadImageOfUser(DatabaseDBUtil.Properties.UserId);
                    JPopupMenu  jPopupMenu       = new JPopupMenu();
                    JMenuItem[] arrayOfJMenuItem = ((BaseRibbon)this.ribbon).UserMenuItems;
                    foreach (JMenuItem jMenuItem in arrayOfJMenuItem)
                    {
                        if (jMenuItem == null)
                        {
                            jPopupMenu.addSeparator();
                        }
                        else
                        {
                            jPopupMenu.add(jMenuItem);
                        }
                    }
                    ((UISplitButton)this.o_trailingButton).Menu = jPopupMenu;
                }
                ((UISplitButton)this.o_trailingButton).ButtonStyle = 3;
                ((UISplitButton)this.o_trailingButton).Foreground  = CostOSWindowsLookAndFeel.ribbonTaskTitleTextForegroundColor;
                this.ribbon.add(this.o_trailingButton);
                this.o_searchButton = ((BaseRibbon)this.ribbon).SearchButton;
                this.o_searchButton.PreferredSize = new Dimension((int)this.o_searchButton.PreferredSize.Width, TaskToggleButtonHeight - 1);
                this.o_searchButton.MaximumSize   = new Dimension((int)this.o_searchButton.PreferredSize.Width, TaskToggleButtonHeight - 1);
                this.ribbon.add(this.o_searchButton);
            }
            ActionListener actionListener2 = this.ribbon.CloseActionListener;

            if (actionListener2 != null)
            {
                this.closeButton = new JCommandButton("", this.ribbon.CloseIcon);
                this.closeButton.DisplayState      = CommandButtonDisplayState.SMALL;
                this.closeButton.CommandButtonKind = JCommandButton.CommandButtonKind.ACTION_ONLY;
                this.closeButton.ActionModel.addActionListener(actionListener2);
                this.ribbon.add(this.closeButton);
            }
            ActionListener actionListener3 = this.ribbon.HelpActionListener;

            if (actionListener3 != null)
            {
                this.helpButton = new JCommandButton("", this.ribbon.HelpIcon);
                this.helpButton.DisplayState      = CommandButtonDisplayState.SMALL;
                this.helpButton.CommandButtonKind = JCommandButton.CommandButtonKind.ACTION_ONLY;
                this.helpButton.ActionModel.addActionListener(actionListener3);
                this.ribbon.add(this.helpButton);
            }
            this.ribbon.revalidate();
            this.ribbon.repaint();
        }
Exemple #9
0
 private MultiSlotEditor(FactEditor enclosingInstance)
 {
     InitBlock(enclosingInstance);
     popupMenu = new JPopupMenu();
     addMenuItem = new JMenuItem("add value", IconLoader.getImageIcon("add"));
     addMenuItem.addActionListener(this);
     editMenuItem = new JMenuItem("edit value", IconLoader.getImageIcon("pencil"));
     editMenuItem.addActionListener(this);
     deleteMenuItem = new JMenuItem("remove value", IconLoader.getImageIcon("delete"));
     deleteMenuItem.addActionListener(this);
     popupMenu.add(addMenuItem);
     popupMenu.add(editMenuItem);
     popupMenu.add(deleteMenuItem);
     popupMenu.addPopupMenuListener(this);
     list = new JList(listModel);
     list.setVisibleRowCount(4);
     //list.setComponentPopupMenu(popupMenu);
 }
 /// <summary>
 /// Set the data set to be displayed. </summary>
 /// <param name="dataset"> StateCU_DataSet that is being displayed/managed. </param>
 public virtual void setDataSet(StateCU_DataSet dataset)
 {
     __dataset          = dataset;
     __popup_JPopupMenu = new JPopupMenu();
 }
 public MouseAdapterAnonymousInnerClass(StateMod_Network_AnnotationDataListJPanel outerInstance, JPopupMenu popupMenu)
 {
     this.outerInstance = outerInstance;
     this.popupMenu     = popupMenu;
 }
Exemple #12
0
 private void initPopupMenu()
 {
     JPopupMenu menu = new JPopupMenu();
     JMenuItem retractItem = new JMenuItem("Retract selected Fact(s)", IconLoader.getImageIcon("database_delete"));
     retractItem.addMouseListener(new AnonymousClassMouseAdapter(this));
     menu.add(retractItem);
     // factsTable.setComponentPopupMenu(menu);
 }