private XYPlot createPeriodCostPlot(TangoColorFactory tangoColorFactory, CheapTimeSolution solution) { XYSeries series = new XYSeries("Power price"); for (PeriodPowerPrice periodPowerPrice : solution.getPeriodPowerPriceList()) { series.add((double) periodPowerPrice.getPowerPriceMicros() / 1000000.0, periodPowerPrice.getPeriod()); } XYSeriesCollection seriesCollection = new XYSeriesCollection(); seriesCollection.addSeries(series); XYItemRenderer renderer = new StandardXYItemRenderer(StandardXYItemRenderer.SHAPES); renderer.setSeriesPaint(0, TangoColorFactory.ORANGE_1); renderer.setSeriesShape(0, ShapeUtilities.createDiamond(2.0F)); NumberAxis domainAxis = new NumberAxis("Power price"); return new XYPlot(seriesCollection, domainAxis, null, renderer); }
@Override public Shape getItemShape(int seriesIndex, int itemIndex) { XYDataItem dataItem = seriesCollection.getSeries(seriesIndex).getDataItem(itemIndex); if (firstActivities.contains(dataItem)) { return ShapeUtilities.createUpTriangle(4.0f); } return ELLIPSE; }
void drawCoordinate( Coordinate c, Graphics2D g2, int series, int item, Rectangle2D dataArea, XYPlot plot, ValueAxis domainAxis, ValueAxis rangeAxis) { double tx = domainAxis.valueToJava2D(c.x, dataArea, plot.getDomainAxisEdge()); double ty = rangeAxis.valueToJava2D(c.y, dataArea, plot.getRangeAxisEdge()); Shape shape = getItemShape(series, item); shape = ShapeUtilities.createTranslatedShape(shape, tx, ty); if (fillCoordinates) { g2.fill(shape); } else { g2.draw(shape); } }
/** * Sets the model comments. * * @param modelComments the model comments. */ public void setModelComments(final Comments modelComments) { Log.debug ("Model: Comment set: " + modelComments); this.modelComments = modelComments; }
/** * Creates a log context. * * @param context the label for the context. * * @return A log context. */ public static LogContext createContext(final String context) { return getInstance().internalCreateContext(context); }
/** * A convenience method for logging a 'warning' message. * * @param message the message. */ public static void warn(final Object message) { log(LogTarget.WARN, message); }
/** * Sets the {@link Shape} for an item in the list. The list is expanded * if necessary. * * @param index the index (zero-based). * @param shape the {@link Shape}. */ public void setShape(final int index, final Shape shape) { set(index, shape); }
/** * Makes this implementation the default instance. */ public static void installDefaultLog () { Log.defineLog(defaultLogInstance); } }
/** * Creates a new line break iterator. * * @param text the text to be broken up. */ public LineBreakIterator(final String text) { setText(text); }
/** * Checks, whether a given property is defined. * * @param name the name of the property * @return true, if the property is defined, false otherwise. */ public boolean isPropertySet (final String name) { return this.parent.getConfigProperty(name) != null; }
/** * Returns an enumeration of the configuration properties. * * @return An enumeration. */ public Enumeration getConfigProperties() { return this.parent.getConfigProperties(); }
/** * Returns true, if the log level allows error messages to be * printed. * * @return true, if messages with an log level of ERROR are allowed. */ public boolean isErrorEnabled() { return Log.isErrorEnabled(); }
/** * A convenience method for logging an 'error' message. * * @param message the message. * @param e the exception. */ public void error(final Object message, final Exception e) { log(LogTarget.ERROR, message, e); }
/** * Returns the configuration property with the specified key. * * @param key the property key. * @return the property value. */ public String getConfigProperty(final String key) { return getProperty(key); }
/** * Returns the boolean value of a given configuration property. The boolean value true * is returned, if the contained string is equal to 'true'. * * @param name the name of the property * @return the boolean value of the property. */ public boolean getBoolProperty (final String name) { return getBoolProperty(name, false); }
/** * Sets a flag that controls whether or not a series is filled. * * @param series the series index. * @param filled the flag. */ public void setSeriesFilled(int series, boolean filled) { this.seriesFilled.setBoolean(series, BooleanUtilities.valueOf(filled)); }
/** * Returns the configuration properties. * * @return An enumeration of the configuration properties. */ public Enumeration getConfigProperties() { return this.parserConfiguration.getConfigProperties(); }
/** * A convenience method for logging an 'error' message. * * @param message the message. */ public static void error(final Object message) { log(LogTarget.ERROR, message); }
renderer.setSeriesShape(seriesIndex, ShapeUtilities.createDiamond(1.5F)); renderer.setSeriesVisibleInLegend(seriesIndex, false); seriesIndex++;
Shape upTriangle = ShapeUtilities.createUpTriangle(3.0f); item.setShape(upTriangle); item.setOutlinePaint(Color.BLACK);