private void refreshTextHeight() { getCmbHeightField().removeAllItems(); boolean enabled = numericFieldNames.length > 0; // getCmbHeightField().setEnabled(enabled); // getRdBtnHeightField().setEnabled(enabled); if (!enabled) { getRdBtnFixedHeight().setSelected(true); } for (int i = 0; i < numericFieldNames.length; i++) { getCmbHeightField().addItem(numericFieldNames[i]); } if (layer.getLabelingStrategy() instanceof AttrInTableLabelingStrategy) { AttrInTableLabelingStrategy aux = (AttrInTableLabelingStrategy) layer.getLabelingStrategy(); try { getTxtHeightField().setText(String.valueOf(aux.getFixedSize())); getRdBtnFixedHeight().setSelected(aux.usesFixedSize()); getRdBtnHeightField().setSelected(!aux.usesFixedSize()); String item = aux.getHeightField(); getCmbHeightField().setSelectedItem(item); } catch (ReadDriverException e) { // should never happen NotificationManager.addWarning( PluginServices.getText(this, "could_not_restore_text_height_field"), e); } } }
private void refreshCmbRefSystem() { if (layer.getLabelingStrategy() instanceof AttrInTableLabelingStrategy) { AttrInTableLabelingStrategy aux = (AttrInTableLabelingStrategy) layer.getLabelingStrategy(); getCmbReferenceSystem().setSelectedIndex(aux.getReferenceSystem()); } }
private void refreshCmbUnits() { if (layer.getLabelingStrategy() instanceof AttrInTableLabelingStrategy) { AttrInTableLabelingStrategy aux = (AttrInTableLabelingStrategy) layer.getLabelingStrategy(); getCmbUnits().setSelectedUnitIndex(aux.getUnit()); } }
private void refreshFont() { if (layer.getLabelingStrategy() instanceof AttrInTableLabelingStrategy) { AttrInTableLabelingStrategy aux = (AttrInTableLabelingStrategy) layer.getLabelingStrategy(); labelFont = aux.getFont(); } }
private void refreshColorFont() { getCmbColorField().removeAllItems(); boolean enabled = integerFieldNames.length > 0; // getCmbColorField().setEnabled(enabled); // getRdBtnColorField().setEnabled(enabled); if (!enabled) { getRdBtnFixedColor().setSelected(true); } for (int i = 0; i < integerFieldNames.length; i++) { getCmbColorField().addItem(integerFieldNames[i]); } if (layer.getLabelingStrategy() instanceof AttrInTableLabelingStrategy) { AttrInTableLabelingStrategy aux = (AttrInTableLabelingStrategy) layer.getLabelingStrategy(); try { getRdBtnFixedColor().setSelected(aux.usesFixedColor()); getRdBtnColorField().setSelected(!aux.usesFixedColor()); String item = aux.getColorField(); getCmbColorField().setSelectedItem(item); getColorChooser().setColor(aux.getFixedColor()); } catch (ReadDriverException e) { // should never happen NotificationManager.addWarning( PluginServices.getText(this, "could_not_restore_color_field"), e); } } }
private void refreshCmbTextField() { getCmbTextField().removeAllItems(); for (int i = 0; i < fieldNames.length; i++) { getCmbTextField().addItem(fieldNames[i]); } if (layer.getLabelingStrategy() instanceof AttrInTableLabelingStrategy) { AttrInTableLabelingStrategy aux = (AttrInTableLabelingStrategy) layer.getLabelingStrategy(); try { String item = aux.getTextField(); getCmbTextField().setSelectedItem(item != null ? item : NO_FIELD_ITEM); } catch (ReadDriverException e) { // should never happen NotificationManager.addWarning( PluginServices.getText(this, "could_not_restore_text_field"), e); } } }