Java Code Examples for org.jfree.ui.RectangleAnchor#CENTER

The following examples show how to use org.jfree.ui.RectangleAnchor#CENTER . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: LegendTitle.java    From ECG-Viewer with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Creates a new legend title with the specified arrangement.
 *
 * @param source  the source.
 * @param hLayout  the horizontal item arrangement (<code>null</code> not
 *                 permitted).
 * @param vLayout  the vertical item arrangement (<code>null</code> not
 *                 permitted).
 */
public LegendTitle(LegendItemSource source,
                   Arrangement hLayout, Arrangement vLayout) {
    this.sources = new LegendItemSource[] {source};
    this.items = new BlockContainer(hLayout);
    this.hLayout = hLayout;
    this.vLayout = vLayout;
    this.backgroundPaint = null;
    this.legendItemGraphicEdge = RectangleEdge.LEFT;
    this.legendItemGraphicAnchor = RectangleAnchor.CENTER;
    this.legendItemGraphicLocation = RectangleAnchor.CENTER;
    this.legendItemGraphicPadding = new RectangleInsets(2.0, 2.0, 2.0, 2.0);
    this.itemFont = DEFAULT_ITEM_FONT;
    this.itemPaint = DEFAULT_ITEM_PAINT;
    this.itemLabelPadding = new RectangleInsets(2.0, 2.0, 2.0, 2.0);
    this.sortOrder = SortOrder.ASCENDING;
}
 
Example 2
Source File: DialValueIndicator.java    From openstock with GNU General Public License v3.0 6 votes vote down vote up
/**
 * Creates a new instance of <code>DialValueIndicator</code>.
 *
 * @param datasetIndex  the dataset index.
 */
public DialValueIndicator(int datasetIndex) {
    this.datasetIndex = datasetIndex;
    this.angle = -90.0;
    this.radius = 0.3;
    this.frameAnchor = RectangleAnchor.CENTER;
    this.templateValue = new Double(100.0);
    this.maxTemplateValue = null;
    this.formatter = new DecimalFormat("0.0");
    this.font = new Font("Dialog", Font.BOLD, 14);
    this.paint = Color.black;
    this.backgroundPaint = Color.white;
    this.outlineStroke = new BasicStroke(1.0f);
    this.outlinePaint = Color.blue;
    this.insets = new RectangleInsets(4, 4, 4, 4);
    this.valueAnchor = RectangleAnchor.RIGHT;
    this.textAnchor = TextAnchor.CENTER_RIGHT;
}
 
Example 3
Source File: DialValueIndicator.java    From SIMVA-SoS with Apache License 2.0 6 votes vote down vote up
/**
 * Creates a new instance of <code>DialValueIndicator</code>.
 *
 * @param datasetIndex  the dataset index.
 */
public DialValueIndicator(int datasetIndex) {
    this.datasetIndex = datasetIndex;
    this.angle = -90.0;
    this.radius = 0.3;
    this.frameAnchor = RectangleAnchor.CENTER;
    this.templateValue = new Double(100.0);
    this.maxTemplateValue = null;
    this.formatter = new DecimalFormat("0.0");
    this.font = new Font("Dialog", Font.BOLD, 14);
    this.paint = Color.black;
    this.backgroundPaint = Color.white;
    this.outlineStroke = new BasicStroke(1.0f);
    this.outlinePaint = Color.blue;
    this.insets = new RectangleInsets(4, 4, 4, 4);
    this.valueAnchor = RectangleAnchor.RIGHT;
    this.textAnchor = TextAnchor.CENTER_RIGHT;
}
 
Example 4
Source File: LegendGraphic.java    From opensim-gui with Apache License 2.0 6 votes vote down vote up
/**
 * Creates a new legend graphic.
 * 
 * @param shape  the shape (<code>null</code> not permitted).
 * @param fillPaint  the fill paint (<code>null</code> not permitted).
 */
public LegendGraphic(Shape shape, Paint fillPaint) {
    if (shape == null) {
        throw new IllegalArgumentException("Null 'shape' argument.");
    }
    if (fillPaint == null) {
        throw new IllegalArgumentException("Null 'fillPaint' argument.");
    }
    this.shapeVisible = true;
    this.shape = shape;
    this.shapeAnchor = RectangleAnchor.CENTER;
    this.shapeLocation = RectangleAnchor.CENTER;
    this.shapeFilled = true;
    this.fillPaint = fillPaint;
    this.fillPaintTransformer = new StandardGradientPaintTransformer();
    setPadding(2.0, 2.0, 2.0, 2.0);
}
 
Example 5
Source File: DialValueIndicator.java    From buffer_bci with GNU General Public License v3.0 6 votes vote down vote up
/**
 * Creates a new instance of <code>DialValueIndicator</code>.
 *
 * @param datasetIndex  the dataset index.
 */
public DialValueIndicator(int datasetIndex) {
    this.datasetIndex = datasetIndex;
    this.angle = -90.0;
    this.radius = 0.3;
    this.frameAnchor = RectangleAnchor.CENTER;
    this.templateValue = new Double(100.0);
    this.maxTemplateValue = null;
    this.formatter = new DecimalFormat("0.0");
    this.font = new Font("Dialog", Font.BOLD, 14);
    this.paint = Color.black;
    this.backgroundPaint = Color.white;
    this.outlineStroke = new BasicStroke(1.0f);
    this.outlinePaint = Color.blue;
    this.insets = new RectangleInsets(4, 4, 4, 4);
    this.valueAnchor = RectangleAnchor.RIGHT;
    this.textAnchor = TextAnchor.CENTER_RIGHT;
}
 
Example 6
Source File: LegendGraphic.java    From openstock with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Creates a new legend graphic.
 *
 * @param shape  the shape (<code>null</code> not permitted).
 * @param fillPaint  the fill paint (<code>null</code> not permitted).
 */
public LegendGraphic(Shape shape, Paint fillPaint) {
    ParamChecks.nullNotPermitted(shape, "shape");
    ParamChecks.nullNotPermitted(fillPaint, "fillPaint");
    this.shapeVisible = true;
    this.shape = shape;
    this.shapeAnchor = RectangleAnchor.CENTER;
    this.shapeLocation = RectangleAnchor.CENTER;
    this.shapeFilled = true;
    this.fillPaint = fillPaint;
    this.fillPaintTransformer = new StandardGradientPaintTransformer();
    setPadding(2.0, 2.0, 2.0, 2.0);
}
 
Example 7
Source File: SpectrumTopComponent.java    From snap-desktop with GNU General Public License v3.0 5 votes vote down vote up
private void setPlotMessage(String messageText) {
    chart.getXYPlot().clearAnnotations();
    TextTitle tt = new TextTitle(messageText);
    tt.setTextAlignment(HorizontalAlignment.RIGHT);
    tt.setFont(chart.getLegend().getItemFont());
    tt.setBackgroundPaint(new Color(200, 200, 255, 50));
    tt.setFrame(new BlockBorder(Color.white));
    tt.setPosition(RectangleEdge.BOTTOM);
    XYTitleAnnotation message = new XYTitleAnnotation(0.5, 0.5, tt, RectangleAnchor.CENTER);
    chart.getXYPlot().addAnnotation(message);
}
 
Example 8
Source File: LabelBlock.java    From SIMVA-SoS with Apache License 2.0 5 votes vote down vote up
/**
 * Creates a new label block.
 *
 * @param text  the text for the label (<code>null</code> not permitted).
 * @param font  the font (<code>null</code> not permitted).
 * @param paint the paint (<code>null</code> not permitted).
 */
public LabelBlock(String text, Font font, Paint paint) {
    this.text = text;
    this.paint = paint;
    this.label = TextUtilities.createTextBlock(text, font, this.paint);
    this.font = font;
    this.toolTipText = null;
    this.urlText = null;
    this.contentAlignmentPoint = TextBlockAnchor.CENTER;
    this.textAnchor = RectangleAnchor.CENTER;
}
 
Example 9
Source File: LabelBlock.java    From ccu-historian with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Creates a new label block.
 *
 * @param text  the text for the label (<code>null</code> not permitted).
 * @param font  the font (<code>null</code> not permitted).
 * @param paint the paint (<code>null</code> not permitted).
 */
public LabelBlock(String text, Font font, Paint paint) {
    this.text = text;
    this.paint = paint;
    this.label = TextUtilities.createTextBlock(text, font, this.paint);
    this.font = font;
    this.toolTipText = null;
    this.urlText = null;
    this.contentAlignmentPoint = TextBlockAnchor.CENTER;
    this.textAnchor = RectangleAnchor.CENTER;
}
 
Example 10
Source File: LegendGraphic.java    From ECG-Viewer with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Creates a new legend graphic.
 *
 * @param shape  the shape (<code>null</code> not permitted).
 * @param fillPaint  the fill paint (<code>null</code> not permitted).
 */
public LegendGraphic(Shape shape, Paint fillPaint) {
    ParamChecks.nullNotPermitted(shape, "shape");
    ParamChecks.nullNotPermitted(fillPaint, "fillPaint");
    this.shapeVisible = true;
    this.shape = shape;
    this.shapeAnchor = RectangleAnchor.CENTER;
    this.shapeLocation = RectangleAnchor.CENTER;
    this.shapeFilled = true;
    this.fillPaint = fillPaint;
    this.fillPaintTransformer = new StandardGradientPaintTransformer();
    setPadding(2.0, 2.0, 2.0, 2.0);
}
 
Example 11
Source File: CategoryLabelPosition.java    From buffer_bci with GNU General Public License v3.0 4 votes vote down vote up
/**
 * Creates a new position record with default settings.
 */
public CategoryLabelPosition() {
    this(RectangleAnchor.CENTER, TextBlockAnchor.BOTTOM_CENTER,
            TextAnchor.CENTER, 0.0, CategoryLabelWidthType.CATEGORY, 0.95f);
}
 
Example 12
Source File: XYImageAnnotation.java    From buffer_bci with GNU General Public License v3.0 2 votes vote down vote up
/**
 * Creates a new annotation to be displayed at the specified (x, y)
 * location.
 *
 * @param x  the x-coordinate (in data space).
 * @param y  the y-coordinate (in data space).
 * @param image  the image (<code>null</code> not permitted).
 */
public XYImageAnnotation(double x, double y, Image image) {
    this(x, y, image, RectangleAnchor.CENTER);
}
 
Example 13
Source File: XYImageAnnotation.java    From opensim-gui with Apache License 2.0 2 votes vote down vote up
/**
 * Creates a new annotation to be displayed at the specified (x, y) 
 * location.
 *
 * @param x  the x-coordinate (in data space).
 * @param y  the y-coordinate (in data space).
 * @param image  the image (<code>null</code> not permitted).
 */
public XYImageAnnotation(double x, double y, Image image) {
    this(x, y, image, RectangleAnchor.CENTER);
}
 
Example 14
Source File: XYImageAnnotation.java    From ccu-historian with GNU General Public License v3.0 2 votes vote down vote up
/**
 * Creates a new annotation to be displayed at the specified (x, y)
 * location.
 *
 * @param x  the x-coordinate (in data space).
 * @param y  the y-coordinate (in data space).
 * @param image  the image (<code>null</code> not permitted).
 */
public XYImageAnnotation(double x, double y, Image image) {
    this(x, y, image, RectangleAnchor.CENTER);
}
 
Example 15
Source File: XYTitleAnnotation.java    From buffer_bci with GNU General Public License v3.0 2 votes vote down vote up
/**
 * Creates a new annotation to be displayed at the specified (x, y)
 * location.
 *
 * @param x  the x-coordinate (in data space).
 * @param y  the y-coordinate (in data space).
 * @param title  the title (<code>null</code> not permitted).
 */
public XYTitleAnnotation(double x, double y, Title title) {
    this(x, y, title, RectangleAnchor.CENTER);
}
 
Example 16
Source File: XYImageAnnotation.java    From buffer_bci with GNU General Public License v3.0 2 votes vote down vote up
/**
 * Creates a new annotation to be displayed at the specified (x, y)
 * location.
 *
 * @param x  the x-coordinate (in data space).
 * @param y  the y-coordinate (in data space).
 * @param image  the image (<code>null</code> not permitted).
 */
public XYImageAnnotation(double x, double y, Image image) {
    this(x, y, image, RectangleAnchor.CENTER);
}
 
Example 17
Source File: XYImageAnnotation.java    From openstock with GNU General Public License v3.0 2 votes vote down vote up
/**
 * Creates a new annotation to be displayed at the specified (x, y)
 * location.
 *
 * @param x  the x-coordinate (in data space).
 * @param y  the y-coordinate (in data space).
 * @param image  the image (<code>null</code> not permitted).
 */
public XYImageAnnotation(double x, double y, Image image) {
    this(x, y, image, RectangleAnchor.CENTER);
}
 
Example 18
Source File: XYTitleAnnotation.java    From openstock with GNU General Public License v3.0 2 votes vote down vote up
/**
 * Creates a new annotation to be displayed at the specified (x, y)
 * location.
 *
 * @param x  the x-coordinate (in data space).
 * @param y  the y-coordinate (in data space).
 * @param title  the title (<code>null</code> not permitted).
 */
public XYTitleAnnotation(double x, double y, Title title) {
    this(x, y, title, RectangleAnchor.CENTER);
}
 
Example 19
Source File: XYImageAnnotation.java    From ECG-Viewer with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Creates a new annotation to be displayed at the specified (x, y)
 * location.
 *
 * @param x  the x-coordinate (in data space).
 * @param y  the y-coordinate (in data space).
 * @param image  the image (<code>null</code> not permitted).
 */
public XYImageAnnotation(double x, double y, Image image) {
    this(x, y, image, RectangleAnchor.CENTER);
}
 
Example 20
Source File: XYTitleAnnotation.java    From ECG-Viewer with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Creates a new annotation to be displayed at the specified (x, y)
 * location.
 *
 * @param x  the x-coordinate (in data space).
 * @param y  the y-coordinate (in data space).
 * @param title  the title (<code>null</code> not permitted).
 */
public XYTitleAnnotation(double x, double y, Title title) {
    this(x, y, title, RectangleAnchor.CENTER);
}