private void checkStyle() { IMap activeMap = ApplicationGIS.getActiveMap(); IBlackboard styleBlackboard = activeMap.getBlackboard(); if (style == null) { style = (RasterLegendStyle) styleBlackboard.get(RasterLegendStyleContent.ID); } if (style == null) { style = RasterLegendStyleContent.createDefault(); styleBlackboard.put(RasterLegendStyleContent.ID, style); // styleBlackboard.setSelected(new String[]{RasterLegendStyleContent.ID}); } }
private void updateBlackboard() { IMap activeMap = ApplicationGIS.getActiveMap(); IBlackboard styleBlackboard = activeMap.getBlackboard(); style = (RasterLegendStyle) styleBlackboard.get(RasterLegendStyleContent.ID); if (style == null) { style = RasterLegendStyleContent.createDefault(); styleBlackboard.put(RasterLegendStyleContent.ID, style); // styleBlackboard.setSelected(new String[]{RasterLegendStyleContent.ID}); } RGB bg = backgroundColour.getColorValue(); try { int bAlpha = Integer.parseInt(backgroundAlphaText.getText()); style.backgroundColor = new Color(bg.red, bg.green, bg.blue, bAlpha); } catch (Exception e) { style.backgroundColor = new Color(bg.red, bg.green, bg.blue); } bg = foregroundColor.getColorValue(); try { int fAlpha = Integer.parseInt(forgroundAlphaText.getText()); style.foregroundColor = new Color(bg.red, bg.green, bg.blue, fAlpha); } catch (Exception e) { style.foregroundColor = new Color(bg.red, bg.green, bg.blue); } bg = fontColour.getColorValue(); style.fontColor = new Color(bg.red, bg.green, bg.blue); style.titleString = titleText.getText(); style.xPos = Integer.parseInt(xposText.getText()); style.yPos = Integer.parseInt(yposText.getText()); style.legendHeight = Integer.parseInt(legHeightText.getText()); style.legendWidth = Integer.parseInt(legWidthText.getText()); style.boxWidth = Integer.parseInt(boxWidthText.getText()); style.isRoundedRectangle = isroundedButton.getSelection(); styleBlackboard.put(RasterLegendStyleContent.ID, style); }