use of com.revolsys.swing.map.layer.record.AbstractRecordLayer in project com.revolsys.open by revolsys.
the class SetRecordsFieldValue method initFieldPanel.
@Override
protected JPanel initFieldPanel() {
final FieldDefinition fieldDefinition = this.getFieldDefinition();
final JPanel fieldPanel = new JPanel();
final String fieldName = fieldDefinition.getName();
final AbstractRecordLayer layer = getLayer();
this.editField = RecordLayerFields.newFormField(layer, fieldName, true);
Property.addListenerNewValue(this.editField, fieldName, (newValue) -> {
validateField(this.editField, fieldDefinition);
});
Property.addListenerNewValue(this.editField, "text", (newValue) -> {
validateField(this.editField, fieldDefinition);
});
fieldPanel.add((Component) this.editField);
GroupLayouts.makeColumns(fieldPanel, 1, true);
return fieldPanel;
}
use of com.revolsys.swing.map.layer.record.AbstractRecordLayer in project com.revolsys.open by revolsys.
the class AbstractRecordLayerRenderer method wrapWithScaleStyle.
public ScaleMultipleRenderer wrapWithScaleStyle() {
final AbstractRecordLayer layer = getLayer();
final AbstractMultipleRenderer parent = (AbstractMultipleRenderer) getParent();
final ScaleMultipleRenderer newRenderer = new ScaleMultipleRenderer(layer, parent);
wrap(layer, parent, newRenderer);
return newRenderer;
}
use of com.revolsys.swing.map.layer.record.AbstractRecordLayer in project com.revolsys.open by revolsys.
the class TextStylePanel method newField.
@Override
protected Field newField(final String fieldName, final Class<?> fieldClass, final Object value) {
if (fieldName.equals("textName")) {
final AbstractRecordLayer layer = getLayer();
final TextNameField textNameField = new TextNameField(layer, fieldName, value);
Property.addListener(textNameField, fieldName, this);
return textNameField;
} else {
return super.newField(fieldName, fieldClass, value);
}
}
use of com.revolsys.swing.map.layer.record.AbstractRecordLayer in project com.revolsys.open by revolsys.
the class RecordLayerTable method initializeColumnPreferredWidth.
@Override
protected void initializeColumnPreferredWidth(final TableColumn column) {
final int columnIndex = column.getModelIndex();
final String fieldName = getColumnFieldName(columnIndex);
if (fieldName != null) {
final AbstractRecordLayer layer = getLayer();
final int width = layer.getFieldColumnWidth(fieldName);
if (width >= 0) {
column.setWidth(width);
column.setPreferredWidth(width);
} else {
super.initializeColumnPreferredWidth(column);
}
}
}
use of com.revolsys.swing.map.layer.record.AbstractRecordLayer in project com.revolsys.open by revolsys.
the class ModeAllList method activate.
@Override
public void activate() {
final AbstractRecordLayer layer = getLayer();
addListeners(Property.addListenerNewValueSource(layer, AbstractRecordLayer.RECORDS_INSERTED, //
this::addCachedRecords), //
newRecordsDeletedListener(layer));
for (final String propertyName : new String[] { "filter", AbstractRecordLayer.RECORDS_CHANGED }) {
addListeners(Property.addListenerRunnable(layer, propertyName, this::refresh));
}
super.activate();
}
Aggregations