- for (Entry<String, DynamicSizeContribution> object : dynamicSizingContributions.entrySet()) {
- DynamicSizeContribution cc = object.getValue();
-
- double min = cc.getDefaultMin();
- double max = cc.getDefaultMax();
- String unit = cc.getUnit();
- String label = cc.getLabel();
-
- DynamicSizeMap map = cc.getDefaultSizeMap();
-
- List<Double> sizes = map.getSizes();
-
- double sizeBarBoxTop = (sizeBarBoxTopInitial + (colorBarBoxHeight * i));
- i++;
-// double backgroundBoxPaddingRight = 20;
-// double backgroundBoxHeight = 50;
-// double backgroundBoxWidth = 300;
-// double backgroundBoxRight = bounds.getMaxX() - backgroundBoxPaddingRight;
-// double backgroundBoxLeft = backgroundBoxRight - backgroundBoxWidth;
-// double backgroundBoxTop = bounds.getMaxY();// + (initialPosition + (position * i));
- g2d.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.8f));
- g2d.setColor(new Color(0.9f, 0.9f, 0.9f, 0.95f));
-
- Rectangle2D vertical = new Rectangle2D.Double(sizeBarBoxLeft, sizeBarBoxTop, colorBarBoxWidth, colorBarBoxHeight);
- g2d.fill(vertical);
-
- double sizeVerticalLeft = sizeBarBoxLeft + 5;
- double sizeVerticalTop = sizeBarBoxTop + 15;
- double sizeVerticalHeigth = colorBarBoxHeight - 30;
-
- double sizeVerticalWidth = (sizeBarBoxWidth - 10) / sizes.size();
-
- Font rulerFont = new Font("Tahoma", Font.PLAIN, DPIUtil.upscale(9));
- g2d.setFont(rulerFont);
- g2d.setColor(Color.BLACK);
-
- String str = Double.toString(max);
- g2d.drawString(str, (int)(sizeBarBoxLeft + sizeBarBoxWidth - 30), (int)(sizeBarBoxTop + sizeBarBoxHeight));
-
- str = Double.toString(min);
- g2d.drawString(str, (int)sizeBarBoxLeft + 1, (int)(sizeBarBoxTop + sizeBarBoxHeight));
-
-
- g2d.setColor(new Color((float)0, (float)0, (float)0.8, 0.8f));
- for (Double size: sizes) {
+ if (dynamicSizingContributions != null) {
+ for (Entry<String, DynamicSizeContribution> object : dynamicSizingContributions.entrySet()) {
+ DynamicSizeContribution cc = object.getValue();
+
+ if (!cc.isUsed())
+ continue;
+
+ double min = cc.getDefaultMin();
+ double max = cc.getDefaultMax();
+ String unit = cc.getUnit();
+ String label = cc.getLabel();
+
+ DynamicSizeMap map = cc.getDefaultSizeMap();
+
+ List<Double> sizes = map.getSizes();
+
+ double sizeBarBoxTop = (sizeBarBoxTopInitial + (colorBarBoxHeight * i));
+ i++;
+
+ g2d.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.8f));
+ g2d.setColor(new Color(0.9f, 0.9f, 0.9f, 0.95f));