use of org.gephi.ui.components.JColorButton in project gephi by gephi.
the class EdgeSettingsPanel method setup.
public void setup() {
VizModel vizModel = VizController.getInstance().getVizModel();
vizModel.addPropertyChangeListener(new PropertyChangeListener() {
@Override
public void propertyChange(PropertyChangeEvent evt) {
if (evt.getPropertyName().equals("init")) {
refreshSharedConfig();
} else if (evt.getPropertyName().equals("edgeHasUniColor")) {
refreshSharedConfig();
} else if (evt.getPropertyName().equals("showEdges")) {
refreshSharedConfig();
} else if (evt.getPropertyName().equals("edgeUniColor")) {
refreshSharedConfig();
} else if (evt.getPropertyName().equals("edgeSelectionColor")) {
refreshSharedConfig();
} else if (evt.getPropertyName().equals("edgeInSelectionColor")) {
refreshSharedConfig();
} else if (evt.getPropertyName().equals("edgeOutSelectionColor")) {
refreshSharedConfig();
} else if (evt.getPropertyName().equals("edgeBothSelectionColor")) {
refreshSharedConfig();
} else if (evt.getPropertyName().equals("edgeScale")) {
refreshSharedConfig();
}
}
});
refreshSharedConfig();
showEdgesCheckbox.addItemListener(new ItemListener() {
@Override
public void itemStateChanged(ItemEvent e) {
VizModel vizModel = VizController.getInstance().getVizModel();
vizModel.setShowEdges(showEdgesCheckbox.isSelected());
setEnable(true);
}
});
((JColorButton) edgeColorButton).addPropertyChangeListener(JColorButton.EVENT_COLOR, new PropertyChangeListener() {
@Override
public void propertyChange(PropertyChangeEvent evt) {
VizModel vizModel = VizController.getInstance().getVizModel();
vizModel.setEdgeUniColor(((JColorButton) edgeColorButton).getColorArray());
}
});
sourceNodeColorCheckbox.addItemListener(new ItemListener() {
@Override
public void itemStateChanged(ItemEvent e) {
VizModel vizModel = VizController.getInstance().getVizModel();
vizModel.setEdgeHasUniColor(!sourceNodeColorCheckbox.isSelected());
}
});
selectionColorCheckbox.addItemListener(new ItemListener() {
@Override
public void itemStateChanged(ItemEvent e) {
VizModel vizModel = VizController.getInstance().getVizModel();
vizModel.setEdgeSelectionColor(selectionColorCheckbox.isSelected());
}
});
edgeInSelectionColorChooser.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent ae) {
VizModel vizModel = VizController.getInstance().getVizModel();
vizModel.setEdgeInSelectionColor(edgeInSelectionColorChooser.getColor().getComponents(null));
}
});
edgeBothSelectionColorChooser.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent ae) {
VizModel vizModel = VizController.getInstance().getVizModel();
vizModel.setEdgeBothSelectionColor(edgeBothSelectionColorChooser.getColor().getComponents(null));
}
});
edgeOutSelectionColorChooser.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent ae) {
VizModel vizModel = VizController.getInstance().getVizModel();
vizModel.setEdgeOutSelectionColor(edgeOutSelectionColorChooser.getColor().getComponents(null));
}
});
scaleSlider.addChangeListener(new ChangeListener() {
@Override
public void stateChanged(ChangeEvent e) {
VizModel vizModel = VizController.getInstance().getVizModel();
if (vizModel.getEdgeScale() != (scaleSlider.getValue() / 10f + 0.1f)) {
vizModel.setEdgeScale(scaleSlider.getValue() / 10f + 0.1f);
}
}
});
}
use of org.gephi.ui.components.JColorButton in project gephi by gephi.
the class DependantColorPanel method setup.
public void setup(DependantColorPropertyEditor propertyEditor) {
this.propertyEditor = propertyEditor;
DependantColor dependantColor = (DependantColor) propertyEditor.getValue();
if (dependantColor.getMode().equals(DependantColor.Mode.CUSTOM)) {
customRadio.setSelected(true);
((JColorButton) colorButton).setColor(dependantColor.getCustomColor());
} else if (dependantColor.getMode().equals(DependantColor.Mode.PARENT)) {
parentRadio.setSelected(true);
}
}
use of org.gephi.ui.components.JColorButton in project gephi by gephi.
the class DependantOriginalColorPanel method initComponents.
/** 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.
*/
@SuppressWarnings("unchecked")
private // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
void initComponents() {
buttonGroup1 = new javax.swing.ButtonGroup();
jXHeader1 = new org.jdesktop.swingx.JXHeader();
colorButton = new JColorButton(Color.BLACK);
customRadio = new javax.swing.JRadioButton();
originalRadio = new javax.swing.JRadioButton();
parentRadio = new javax.swing.JRadioButton();
// NOI18N
jXHeader1.setDescription(org.openide.util.NbBundle.getMessage(DependantOriginalColorPanel.class, "DependantOriginalColorPanel.jXHeader1.description"));
// NOI18N
jXHeader1.setTitle(org.openide.util.NbBundle.getMessage(DependantOriginalColorPanel.class, "DependantOriginalColorPanel.jXHeader1.title"));
buttonGroup1.add(customRadio);
// NOI18N
customRadio.setText(org.openide.util.NbBundle.getMessage(DependantOriginalColorPanel.class, "DependantOriginalColorPanel.customRadio.text"));
buttonGroup1.add(originalRadio);
// NOI18N
originalRadio.setText(org.openide.util.NbBundle.getMessage(DependantOriginalColorPanel.class, "DependantOriginalColorPanel.originalRadio.text"));
buttonGroup1.add(parentRadio);
// NOI18N
parentRadio.setText(org.openide.util.NbBundle.getMessage(DependantOriginalColorPanel.class, "DependantOriginalColorPanel.parentRadio.text"));
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
this.setLayout(layout);
layout.setHorizontalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup(layout.createSequentialGroup().addContainerGap().addComponent(originalRadio).addContainerGap(360, Short.MAX_VALUE)).addGroup(layout.createSequentialGroup().addContainerGap().addComponent(parentRadio).addContainerGap(365, Short.MAX_VALUE)).addComponent(jXHeader1, javax.swing.GroupLayout.DEFAULT_SIZE, 435, Short.MAX_VALUE).addGroup(layout.createSequentialGroup().addContainerGap().addComponent(customRadio).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).addComponent(colorButton).addContainerGap(326, Short.MAX_VALUE)));
layout.setVerticalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup(layout.createSequentialGroup().addComponent(jXHeader1, javax.swing.GroupLayout.PREFERRED_SIZE, 77, javax.swing.GroupLayout.PREFERRED_SIZE).addGap(18, 18, 18).addComponent(originalRadio).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED).addComponent(parentRadio).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED).addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addComponent(customRadio).addComponent(colorButton)).addGap(47, 47, 47)));
}
use of org.gephi.ui.components.JColorButton in project gephi by gephi.
the class EdgeColorPanel method setup.
public void setup(EdgeColorPropertyEditor propertyEditor) {
this.propertyEditor = propertyEditor;
EdgeColor edgeColor = (EdgeColor) propertyEditor.getValue();
if (edgeColor.getMode().equals(EdgeColor.Mode.CUSTOM)) {
customRadio.setSelected(true);
((JColorButton) colorButton).setColor(edgeColor.getCustomColor());
} else if (edgeColor.getMode().equals(EdgeColor.Mode.MIXED)) {
mixedRadio.setSelected(true);
} else if (edgeColor.getMode().equals(EdgeColor.Mode.ORIGINAL)) {
originalRadio.setSelected(true);
} else if (edgeColor.getMode().equals(EdgeColor.Mode.SOURCE)) {
sourceRadio.setSelected(true);
} else if (edgeColor.getMode().equals(EdgeColor.Mode.TARGET)) {
targetRadio.setSelected(true);
}
}
use of org.gephi.ui.components.JColorButton in project gephi by gephi.
the class EdgeColorPanel method initComponents.
/** 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.
*/
@SuppressWarnings("unchecked")
private // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
void initComponents() {
buttonGroup1 = new javax.swing.ButtonGroup();
jXHeader1 = new org.jdesktop.swingx.JXHeader();
originalRadio = new javax.swing.JRadioButton();
mixedRadio = new javax.swing.JRadioButton();
sourceRadio = new javax.swing.JRadioButton();
targetRadio = new javax.swing.JRadioButton();
customRadio = new javax.swing.JRadioButton();
colorButton = new JColorButton(Color.BLACK);
// NOI18N
jXHeader1.setDescription(org.openide.util.NbBundle.getMessage(EdgeColorPanel.class, "EdgeColorPanel.jXHeader1.description"));
// NOI18N
jXHeader1.setTitle(org.openide.util.NbBundle.getMessage(EdgeColorPanel.class, "EdgeColorPanel.jXHeader1.title"));
buttonGroup1.add(originalRadio);
// NOI18N
originalRadio.setText(org.openide.util.NbBundle.getMessage(EdgeColorPanel.class, "EdgeColorPanel.originalRadio.text"));
buttonGroup1.add(mixedRadio);
// NOI18N
mixedRadio.setText(org.openide.util.NbBundle.getMessage(EdgeColorPanel.class, "EdgeColorPanel.mixedRadio.text"));
buttonGroup1.add(sourceRadio);
// NOI18N
sourceRadio.setText(org.openide.util.NbBundle.getMessage(EdgeColorPanel.class, "EdgeColorPanel.sourceRadio.text"));
buttonGroup1.add(targetRadio);
// NOI18N
targetRadio.setText(org.openide.util.NbBundle.getMessage(EdgeColorPanel.class, "EdgeColorPanel.targetRadio.text"));
buttonGroup1.add(customRadio);
// NOI18N
customRadio.setText(org.openide.util.NbBundle.getMessage(EdgeColorPanel.class, "EdgeColorPanel.customRadio.text"));
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
this.setLayout(layout);
layout.setHorizontalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup(layout.createSequentialGroup().addContainerGap().addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addComponent(originalRadio).addComponent(mixedRadio).addComponent(sourceRadio).addComponent(targetRadio).addGroup(layout.createSequentialGroup().addComponent(customRadio).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED).addComponent(colorButton))).addContainerGap(323, Short.MAX_VALUE)).addComponent(jXHeader1, javax.swing.GroupLayout.DEFAULT_SIZE, 438, Short.MAX_VALUE));
layout.setVerticalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup(layout.createSequentialGroup().addComponent(jXHeader1, javax.swing.GroupLayout.PREFERRED_SIZE, 81, javax.swing.GroupLayout.PREFERRED_SIZE).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).addComponent(originalRadio).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED).addComponent(mixedRadio).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED).addComponent(sourceRadio).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED).addComponent(targetRadio).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED).addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE).addComponent(customRadio).addComponent(colorButton)).addContainerGap(7, Short.MAX_VALUE)));
}
Aggregations