📄 graticulelayer.java
字号:
} properties.put(prefix + OneDegreeColorProperty, colorString); if (belowOneDegreeColor == null) { colorString = defaultBelowOneDegreeColorString; } else { colorString = Integer.toHexString(belowOneDegreeColor.getRGB()); } properties.put(prefix + BelowOneDegreeColorProperty, colorString); if (equatorColor == null) { colorString = defaultEquatorColorString; } else { colorString = Integer.toHexString(equatorColor.getRGB()); } properties.put(prefix + EquatorColorProperty, colorString); if (dateLineColor == null) { colorString = defaultDateLineColorString; } else { colorString = Integer.toHexString(dateLineColor.getRGB()); } properties.put(prefix + DateLineColorProperty, colorString); if (specialLineColor == null) { colorString = defaultSpecialLineColorString; } else { colorString = Integer.toHexString(specialLineColor.getRGB()); } properties.put(prefix + SpecialLineColorProperty, colorString); if (textColor == null) { colorString = defaultTextColorString; } else { colorString = Integer.toHexString(textColor.getRGB()); } properties.put(prefix + TextColorProperty, colorString); properties.put(prefix + ThresholdProperty, Integer.toString(threshold)); properties.put(prefix + FontSizeProperty, Integer.toString(fontSize)); //DNA properties.put(prefix + ShowOneAndFiveProperty, new Boolean(showOneAndFiveLines).toString()); properties.put(prefix + ShowBelowOneProperty, new Boolean(showBelowOneLines).toString()); properties.put(prefix + ShowRulerProperty, new Boolean(showRuler).toString()); return properties; } /** * The properties and prefix are managed and decoded here, for the * standard uses of the GraticuleLayer. * * @param properties the properties set in the properties file. */ public Properties getPropertyInfo(Properties properties) { properties = super.getPropertyInfo(properties); String interString; properties.put(initPropertiesProperty, TenDegreeColorProperty + " " + FiveDegreeColorProperty + " " + OneDegreeColorProperty + " " + /*BelowOneDegreeColorProperty + " " + */ EquatorColorProperty + " " + DateLineColorProperty + " " + SpecialLineColorProperty + " " + ShowOneAndFiveProperty /* + " " + ShowBelowOneProperty */ + " " + ShowRulerProperty + " " + ThresholdProperty + " " + FontSizeProperty); interString = i18n.get(GraticuleLayer.class, TenDegreeColorProperty, I18n.TOOLTIP, "Color of the ten degree graticule lines."); properties.put(TenDegreeColorProperty, interString); interString = i18n.get(GraticuleLayer.class, TenDegreeColorProperty, "Ten Degree Color"); properties.put(TenDegreeColorProperty + LabelEditorProperty, interString); properties.put(TenDegreeColorProperty + ScopedEditorProperty, "com.bbn.openmap.util.propertyEditor.ColorPropertyEditor"); interString = i18n.get(GraticuleLayer.class, FiveDegreeColorProperty, I18n.TOOLTIP, "Color of the five degree graticule lines."); properties.put(FiveDegreeColorProperty, interString); interString = i18n.get(GraticuleLayer.class, FiveDegreeColorProperty, "Color of the five degree graticule lines."); interString = i18n.get(GraticuleLayer.class, FiveDegreeColorProperty, "File Degree Color"); properties.put(FiveDegreeColorProperty + LabelEditorProperty, interString); properties.put(FiveDegreeColorProperty + ScopedEditorProperty, "com.bbn.openmap.util.propertyEditor.ColorPropertyEditor"); interString = i18n.get(GraticuleLayer.class, OneDegreeColorProperty, I18n.TOOLTIP, "Color of the one degree graticule lines."); properties.put(OneDegreeColorProperty, interString); interString = i18n.get(GraticuleLayer.class, OneDegreeColorProperty, "1 Degree Color"); properties.put(OneDegreeColorProperty + LabelEditorProperty, interString); properties.put(OneDegreeColorProperty + ScopedEditorProperty, "com.bbn.openmap.util.propertyEditor.ColorPropertyEditor"); interString = i18n.get(GraticuleLayer.class, BelowOneDegreeColorProperty, I18n.TOOLTIP, "Color of the sub-one degree graticule lines."); properties.put(BelowOneDegreeColorProperty, interString); interString = i18n.get(GraticuleLayer.class, BelowOneDegreeColorProperty, "Sub-One Degree Color"); properties.put(BelowOneDegreeColorProperty + LabelEditorProperty, interString); properties.put(BelowOneDegreeColorProperty + ScopedEditorProperty, "com.bbn.openmap.util.propertyEditor.ColorPropertyEditor"); interString = i18n.get(GraticuleLayer.class, EquatorColorProperty, I18n.TOOLTIP, "Color of the Equator."); properties.put(EquatorColorProperty, interString); interString = i18n.get(GraticuleLayer.class, EquatorColorProperty, "Equator Line Color"); properties.put(EquatorColorProperty + LabelEditorProperty, interString); properties.put(EquatorColorProperty + ScopedEditorProperty, "com.bbn.openmap.util.propertyEditor.ColorPropertyEditor"); interString = i18n.get(GraticuleLayer.class, DateLineColorProperty, I18n.TOOLTIP, "Color of the Date line."); properties.put(DateLineColorProperty, interString); interString = i18n.get(GraticuleLayer.class, DateLineColorProperty, "Date Line Color"); properties.put(DateLineColorProperty + LabelEditorProperty, interString); properties.put(DateLineColorProperty + ScopedEditorProperty, "com.bbn.openmap.util.propertyEditor.ColorPropertyEditor"); interString = i18n.get(GraticuleLayer.class, SpecialLineColorProperty, I18n.TOOLTIP, "Color of Tropic of Cancer, Capricorn lines."); properties.put(SpecialLineColorProperty, interString); interString = i18n.get(GraticuleLayer.class, SpecialLineColorProperty, "Special Line Color"); properties.put(SpecialLineColorProperty + LabelEditorProperty, interString); properties.put(SpecialLineColorProperty + ScopedEditorProperty, "com.bbn.openmap.util.propertyEditor.ColorPropertyEditor"); interString = i18n.get(GraticuleLayer.class, TextColorProperty, I18n.TOOLTIP, "Color of the line label text."); properties.put(TextColorProperty, interString); interString = i18n.get(GraticuleLayer.class, TextColorProperty, "Text Color"); properties.put(TextColorProperty + LabelEditorProperty, interString); properties.put(TextColorProperty + ScopedEditorProperty, "com.bbn.openmap.util.propertyEditor.ColorPropertyEditor"); interString = i18n.get(GraticuleLayer.class, ThresholdProperty, I18n.TOOLTIP, "The number of lines showing before finer grain lines appear."); properties.put(ThresholdProperty, interString); interString = i18n.get(GraticuleLayer.class, ThresholdProperty, "Line Threshold"); properties.put(ThresholdProperty + LabelEditorProperty, interString); interString = i18n.get(GraticuleLayer.class, ShowOneAndFiveProperty, I18n.TOOLTIP, "Show the one and five degree lines."); properties.put(ShowOneAndFiveProperty, interString); interString = i18n.get(GraticuleLayer.class, ShowOneAndFiveProperty, "Show 1 and 5 Lines"); properties.put(ShowOneAndFiveProperty + LabelEditorProperty, interString); properties.put(ShowOneAndFiveProperty + ScopedEditorProperty, "com.bbn.openmap.util.propertyEditor.TrueFalsePropertyEditor"); interString = i18n.get(GraticuleLayer.class, ShowBelowOneProperty, I18n.TOOLTIP, "Show the one and five degree lines."); properties.put(ShowBelowOneProperty, interString); interString = i18n.get(GraticuleLayer.class, ShowBelowOneProperty, "Show Sub-1 Lines"); properties.put(ShowBelowOneProperty + LabelEditorProperty, interString); properties.put(ShowBelowOneProperty + ScopedEditorProperty, "com.bbn.openmap.util.propertyEditor.TrueFalsePropertyEditor"); interString = i18n.get(GraticuleLayer.class, ShowRulerProperty, I18n.TOOLTIP, "Show the line label text."); properties.put(ShowRulerProperty, interString); interString = i18n.get(GraticuleLayer.class, ShowRulerProperty, "Show Labels"); properties.put(ShowRulerProperty + LabelEditorProperty, interString); properties.put(ShowRulerProperty + ScopedEditorProperty, "com.bbn.openmap.util.propertyEditor.TrueFalsePropertyEditor"); //DNA interString = i18n.get(GraticuleLayer.class, FontSizeProperty, I18n.TOOLTIP, "The size of the font, in points, of the line labels."); properties.put(FontSizeProperty, interString); interString = i18n.get(GraticuleLayer.class, FontSizeProperty, "Label Font Size"); properties.put(FontSizeProperty + LabelEditorProperty, interString); //DNA return properties; } /** * Implementing the ProjectionPainter interface. */ public synchronized void renderDataForProjection(Projection proj, java.awt.Graphics g) { if (proj == null) { Debug.error("GraticuleLayer.renderDataForProjection: null projection!"); return; } else if (!proj.equals(getProjection())) { setProjection(proj.makeClone()); // Figure out which line type to use if (proj instanceof Cylindrical) boxy = true; else boxy = false; setList(constructGraticuleLines()); } paint(g); } /** * Invoked when the projection has changed or this Layer has been * added to the MapBean. * <p> * Perform some extra checks to see if reprojection of the * graphics is really necessary. * * @param e ProjectionEvent * */ public void projectionChanged(ProjectionEvent e) { // extract the projection and check to see if it's really // different. // if it isn't then we don't need to do all the work again, // just // repaint. Projection proj = setProjection(e); if (proj == null) { repaint(); return; } // Figure out which line type to use if (proj instanceof Cylindrical) boxy = true; else boxy = false; setList(null); doPrepare(); } /** * Creates the OMGraphic list with graticule lines. */ public synchronized OMGraphicList prepare() { return constructGraticuleLines(); } /** * Create the graticule lines. * <p> * NOTES: * <ul> * <li>Currently graticule lines are hardcoded to 10 degree * intervals. * <li>No thought has been given to clipping based on the view * rectangle. For non-boxy projections performance may be degraded * at very large scales. (But we make up for this by running the * task in its own thread to support liveness). * </ul> * * @return OMGraphicList new graphic list */ protected OMGraphicList constructGraticuleLines() { OMGraphicList newgraphics = new OMGraphicList(20); // Lets figure out which lines should be painted... Projection projection = getProjection(); if (projection == null) { return newgraphics; }
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -