Package simtools.ui

Examples of simtools.ui.DynamicColorChooser


            bColor.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
       
       
            DynamicColorChooser dialog = new DynamicColorChooser(
                            new JDialog(),
                            resources.getString("SelectAColor"),
                            null,color,colorMapperSource,colorMapper);


            if (dialog.isOk()){

                color = dialog.getColor();
                bColor.setBackground(color);


                DataSource colorTempDataSource = dialog.getSource();
                colorMapper = dialog.getMapper();

                        if  (colorTempDataSource!=null){
                           
                            if (colorMapperSource!=null)
                                colorMapperSource.removeEndNotificationListener(colorMapperManager);
View Full Code Here


      pcurvecolor.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            if (pactiveEntry==null) return;

            DynamicColorChooser dialog = new DynamicColorChooser(
                    null, resources.getString("ChooseAColor"),null ,pactiveEntry.color,pactiveEntry.source,pactiveEntry.mapper);


            dialog.pack();
            dialog.setVisible(true);

            if (dialog.isOk()){
                pactiveEntry.color = dialog.getColor();
                pactiveEntry.source = dialog.getSource();
                pactiveEntry.mapper = dialog.getMapper();
                pupdateForEntry(pactiveEntry);
            }
        }
      });
View Full Code Here

     
      pcurvecolor.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
          if (pactiveEntry==null) return;
  
                    DynamicColorChooser dialog = new DynamicColorChooser(
                            null, resources.getString("ChooseAColor"),null ,pactiveEntry.color,pactiveEntry.source,pactiveEntry.mapper);


                    dialog.pack();
                    dialog.setVisible(true);

                    if (dialog.isOk()){
                        pactiveEntry.color = dialog.getColor();
                        pactiveEntry.source = dialog.getSource();
                        pactiveEntry.mapper = dialog.getMapper();
                        pupdateForEntry(pactiveEntry);
                    }
        }
      });
View Full Code Here

            add(box);

            bBaseColor.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent e) {

                    DynamicColorChooser dialog = new DynamicColorChooser(
                            new JDialog(),
                            NodeResourcesManager.resources.getString("SelectAColor"),
                            null,baseColor,baseColorMapperSource,baseColorMapper);

                    dialog.pack();
                    dialog.setVisible(true);

                    if (dialog.isOk()){
                        baseColor = dialog.getColor();
                        bBaseColor.setBackground(baseColor);
                        DataSource baseColorTempDataSource = dialog.getSource();
                        baseColorMapper = dialog.getMapper();

                        if  (baseColorTempDataSource!=null){

                            if (baseColorMapperSource!=null)
                                baseColorMapperSource.removeEndNotificationListener(ShapeNode.this);

                            baseColorMapperSource  = baseColorTempDataSource;
                            baseColorMapperSource.addEndNotificationListener(ShapeNode.this);  
                        }

                    }
                }
      });
           
           
            bHighlightColor.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
         
                    DynamicColorChooser dialog = new DynamicColorChooser(
                            new JDialog(),
                            NodeResourcesManager.resources.getString("SelectAColor"),
                            null,highlightColor,highlightColorMapperSource,highlightColorMapper);
                   

                    if (dialog.isOk()){
            highlightColor = dialog.getColor();
            bHighlightColor.setBackground(highlightColor);
           
              DataSource highlightColorTempDataSource = dialog.getSource();
                        highlightColorMapper = dialog.getMapper();

                        if  (highlightColorTempDataSource!=null){
                           
                            if (highlightColorMapperSource!=null)
                                highlightColorMapperSource.removeEndNotificationListener(ShapeNode.this);
View Full Code Here

      pcurvecolor.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
          if (pactiveEntry==null) return;
         
            DynamicColorChooser dialog = new DynamicColorChooser(
                            null, resources.getString("ChooseAColor"),null ,pactiveEntry.color,pactiveEntry.source,pactiveEntry.mapper);


            dialog.pack();
            dialog.setVisible(true);

            if (dialog.isOk()){
                pactiveEntry.color = dialog.getColor();
                pactiveEntry.source = dialog.getSource();
                pactiveEntry.mapper = dialog.getMapper();
                pupdateForEntry(pactiveEntry);
            }
       
         
        }
View Full Code Here

      pcurvecolor.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
          if (pactiveEntry==null) return;
         
           DynamicColorChooser dialog = new DynamicColorChooser(
                              null, resources.getString("ChooseAColor"),null ,pactiveEntry.color,pactiveEntry.source,pactiveEntry.mapper);


                      dialog.pack();
                      dialog.setVisible(true);

                      if (dialog.isOk()){
                          pactiveEntry.color = dialog.getColor();
                          pactiveEntry.source = dialog.getSource();
                          pactiveEntry.mapper = dialog.getMapper();
                          pupdateForEntry(pactiveEntry);
                      }
        }
      });

      pcurvedelete.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
          if (pactiveEntry==null) return;
          pcbxcurves.removeItem(pactiveEntry);
        }
      });

      // Now handle Secondary Y axis
      if (plot.getSecondaryRangeAxis(0) != null) {
        section = new Box(BoxLayout.Y_AXIS);
        section.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(),resources.getString("SecondaryYAxis")));
        panel = new JPanel();
        panel.setLayout(new FlowLayout(FlowLayout.LEFT));
        panel.add(scbautoy = new ActionCheckBox(resources.getString("Auto-update"), plot.getSecondaryRangeAxis(0).isAutoRange()) {
          public void actionPerformed(ActionEvent e) {
            scbfixedautoy.setEnabled(isSelected());
            scbfixedautoy.apply();
            slpymin.setEnabled(!isSelected());
            slpymax.setEnabled(!isSelected());
            stfpymin.setEnabled(!isSelected());
            stfpymax.setEnabled(!isSelected());
          }
        });
        autorange = plot.getSecondaryRangeAxis(0).getFixedAutoRange();
        panel.add(scbfixedautoy = new ActionCheckBox(resources.getString("FixedRange"),autorange!=0) {
          public void actionPerformed(ActionEvent e) {
            snffixedautoy.setEnabled(isSelected() && isEnabled());
          }
        });
        panel.add(snffixedautoy = new NumberField(autorange,8));
        panel.add(slpymin = new JLabel(resources.getString("minLabel")));
        panel.add(stfpymin = new NumberField(8));
        stfpymin.setValue(plot.getSecondaryRangeAxis(0).getLowerBound());
        panel.add(slpymax = new JLabel(resources.getString("maxLabel")));
        panel.add(stfpymax = new NumberField(8));
        stfpymax.setValue(plot.getSecondaryRangeAxis(0).getUpperBound());
        section.add(panel);
        scbautoy.apply();
 
        section.add(panel);
 
        box = Box.createHorizontalBox();
 
        box.add(new JLabel(resources.getString("Curves:")));
        box.add(scbxcurves = new JComboBox());
        box.add(scurvecolor = new JButton("    "));
        box.add(scurvedelete = new JButton(resources.getString("Delete")));
        section.add(box);
        content.add(section);
 
        scbxcurves.setEditable(true);
        //noCurveColor = scurvecolor.getBackground();
        scurvecolor.setFocusPainted(false);
        dst = (SourceXYDataset)plot.getSecondaryDataset(0);
        n = dst.getSeriesCount();
        renderer = (JSynopticXYItemRenderer)plot.getSecondaryRenderer(0);
        for (int i=0; i<n; ++i) {
          DataSource ds = renderer.getDataSource(i);
          if (ds==null) {
            ds = dst.getYSource(i); // take the datasource associated with this curve by default
            DataSource linked = DataInfo.getLinkedSource(ds); // and follow link if necessary
            if (linked!=null) ds = linked;
          }
          scbxcurves.addItem(new CbxEntry(i,dst.getSeriesName(i),(Color)renderer.getSeriesPaint(i),ds,renderer.getColorMapper(i)));
        }
        scbxeditortf = (JTextField)scbxcurves.getEditor().getEditorComponent();
        supdateForEntry(scbxcurves.getSelectedItem());
       
        scbxcurves.addPopupMenuListener(new PopupMenuListener() {
          public void popupMenuWillBecomeVisible(PopupMenuEvent e) {
            seditLocked = true;
          }
          public void popupMenuWillBecomeInvisible(PopupMenuEvent e) {
            seditLocked = false;
          }
          public void popupMenuCanceled(PopupMenuEvent e) {
            seditLocked = false;
          }
        });
 
        scbxcurves.addItemListener(new ItemListener() {
          public void itemStateChanged(ItemEvent e) {
            if (e.getStateChange()==ItemEvent.DESELECTED) sactiveEntry = null;
            else supdateForEntry(e.getItem());
          }
        });
 
        scbxeditortf.getDocument().addDocumentListener(new DocumentListener() {
          public void insertUpdate(DocumentEvent e) {
            updateName();
          }
          public void removeUpdate(DocumentEvent e) {
            updateName();
          }
          public void changedUpdate(DocumentEvent e) {
            updateName();
          }
          public void updateName() {
            if ((seditLocked) || (sactiveEntry == null)) return;
            sactiveEntry.name = scbxeditortf.getText();
          }
        });
 
        scurvecolor.addActionListener(new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            if (sactiveEntry==null) return;
           
             DynamicColorChooser dialog = new DynamicColorChooser(
                                null, resources.getString("ChooseAColor"),null ,pactiveEntry.color,pactiveEntry.source,pactiveEntry.mapper);


                        dialog.pack();
                        dialog.setVisible(true);

                        if (dialog.isOk()){
                            pactiveEntry.color = dialog.getColor();
                            pactiveEntry.source = dialog.getSource();
                            pactiveEntry.mapper = dialog.getMapper();
                            pupdateForEntry(pactiveEntry);
                        }
                       
          }
        });
View Full Code Here

        bdrawcolor.setFocusPainted(false);
        bdrawcolor.setBackground(drawColor);
        bdrawcolor.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
               
                DynamicColorChooser dialog = new DynamicColorChooser(
                        PropertiesPanel1D.this.getOwner(),
                        lineColorChooserTitle(),
                        null, drawColor, drawMapperSource, drawMapper);
               
                dialog.pack();
                dialog.setVisible(true);

                if (dialog.isOk()){
                    drawColor =  dialog.getColor();
                    bdrawcolor.setBackground(drawColor);
                    drawMapperSource = dialog.getSource();
                    drawMapper = dialog.getMapper();

                    if (cbdraw != null) {
                        cbdraw.setSelected(true);
                        displayStrokeCustomisation(true);
                    }
View Full Code Here

        }
        bfillcolor.setBackground(fillColor);
        bfillcolor.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
               
                DynamicColorChooser dialog = new DynamicColorChooser(
                        PropertiesPanel2D.this.getOwner(),
                        fillColorChooserTitle(),
                        null, fillColor, fillMapperSource, fillMapper);
               
                dialog.pack();
                dialog.setVisible(true);

                if (dialog.isOk()){

                    fillColor = dialog.getColor();
                    bfillcolor.setBackground(fillColor);

                    fillMapperSource = dialog.getSource();
                    fillMapper = dialog.getMapper();

                    cbfill.setSelected(true);
                }
            }
        });
View Full Code Here

TOP

Related Classes of simtools.ui.DynamicColorChooser

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.