Search in sources :

Example 1 with SparklineComponent

use of org.gephi.utils.sparklines.SparklineComponent in project gephi-plugins-bootcamp by gephi.

the class InteractiveSparkline method execute.

@Override
public void execute() {
    // Show interactive sparkline window:
    // Dimension is automatically updated by SparklineComponent
    SparklineParameters parameters = new SparklineParameters(200, 20, SparklineParameters.DEFAULT_LINE_COLOR, new Color(225, 255, 255), Color.RED, Color.GREEN);
    parameters.setHighlightTextColor(SparklineParameters.DEFAULT_TEXT_COLOR);
    parameters.setHighlightTextBoxColor(SparklineParameters.DEFAULT_TEXT_BOX_COLOR);
    // True makes it interactive to mouse
    SparklineComponent sparklineUI = new SparklineComponent(xValues, yValues, parameters, true);
    // Initial size
    sparklineUI.setPreferredSize(new Dimension(200, 20));
    // Using Netbeans RCP Dialogs API:
    DialogDescriptor dd = new DialogDescriptor(sparklineUI, column.getTitle());
    dd.setModal(false);
    // No buttons
    dd.setOptions(new Object[0]);
    DialogDisplayer.getDefault().createDialog(dd).setVisible(true);
}
Also used : SparklineComponent(org.gephi.utils.sparklines.SparklineComponent) SparklineParameters(org.gephi.utils.sparklines.SparklineParameters) Color(java.awt.Color) DialogDescriptor(org.openide.DialogDescriptor) Dimension(java.awt.Dimension)

Aggregations

Color (java.awt.Color)1 Dimension (java.awt.Dimension)1 SparklineComponent (org.gephi.utils.sparklines.SparklineComponent)1 SparklineParameters (org.gephi.utils.sparklines.SparklineParameters)1 DialogDescriptor (org.openide.DialogDescriptor)1