mirror of
https://github.com/bancika/diy-layout-creator
synced 2026-11-10 17:22:09 +10:00
Added 'Font Size Override' property to most components that display text
to allow control over font size
This commit is contained in:
@@ -160,7 +160,8 @@ Folded|Gefaltet
|
||||
Font|Schriftart
|
||||
Font Bold|Fettschrift
|
||||
Font Italic|Kursivschrift
|
||||
Font Size|Schriftgröße
|
||||
Font Size|Schriftgröße
|
||||
Font Size Override|Überschreiben der Schriftgröße
|
||||
Four|Vier
|
||||
Full|Voll
|
||||
Fuse|Sicherung
|
||||
|
||||
@@ -157,6 +157,7 @@ Font
|
||||
Font Bold
|
||||
Font Italic
|
||||
Font Size
|
||||
Font Size Override
|
||||
Four
|
||||
Full
|
||||
Fuse
|
||||
|
||||
@@ -158,6 +158,7 @@ Font|Fuente
|
||||
Font Bold|Negrita
|
||||
Font Italic|Itálica
|
||||
Font Size|Tamaño de fuente
|
||||
Font Size Override|Anulación del tamaño de fuente
|
||||
Four|Cuatro
|
||||
Full|Lleno
|
||||
Fuse|Fusible
|
||||
|
||||
@@ -158,6 +158,7 @@ Font|Police
|
||||
Font Bold|Gras
|
||||
Font Italic|Italic
|
||||
Font Size|Taille de police
|
||||
Font Size Override|Taille de police (re)
|
||||
Four|Quatre
|
||||
Full|Complet
|
||||
Fuse|Fusible
|
||||
|
||||
@@ -161,6 +161,7 @@ Font|Carattere
|
||||
Font Bold|Carattere grassetto
|
||||
Font Italic|Carattere corsivo
|
||||
Font Size|Dimensione carattere
|
||||
Font Size Override|Sostituzione dimensione carattere
|
||||
Four|Quattro
|
||||
Full|Pieno
|
||||
Fuse|Fusibile
|
||||
|
||||
@@ -161,6 +161,7 @@ Font|Lettertype
|
||||
Font Bold|Vet lettertype
|
||||
Font Italic|Cursief lettertype
|
||||
Font Size|Tekengrootte
|
||||
Font Size Override|Tekengrootte overschrijven
|
||||
Four|Vier
|
||||
Full|Vol
|
||||
Fuse|Zekering
|
||||
|
||||
@@ -157,6 +157,7 @@ Font
|
||||
Font Bold
|
||||
Font Italic
|
||||
Font Size|Veličina Fonta
|
||||
Font Size Override|Veličina Fonta
|
||||
Four|Četiri
|
||||
Full|Puno
|
||||
Fuse|Osigurač
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -39,8 +39,9 @@ public class IntEditor extends DoubleTextField {
|
||||
public IntEditor(final PropertyWrapper property) {
|
||||
setLayout(new BorderLayout());
|
||||
if (property.isReadOnly())
|
||||
setEnabled(false);
|
||||
setValue((double) (Integer) property.getValue());
|
||||
setEnabled(false);
|
||||
if (property.getValue() != null)
|
||||
setValue((double) (Integer) property.getValue());
|
||||
addPropertyChangeListener(DoubleTextField.VALUE_PROPERTY, new PropertyChangeListener() {
|
||||
|
||||
@Override
|
||||
|
||||
@@ -142,45 +142,49 @@ public class PropertyEditorDialog extends ButtonDialog {
|
||||
gbc.weightx = 1;
|
||||
gbc.insets = new Insets(2, 2, 2, 2);
|
||||
|
||||
Component editor = FieldEditorFactory.createFieldEditor(property);
|
||||
editor.addKeyListener(new KeyAdapter() {
|
||||
try {
|
||||
Component editor = FieldEditorFactory.createFieldEditor(property);
|
||||
editor.addKeyListener(new KeyAdapter() {
|
||||
|
||||
@Override
|
||||
public void keyPressed(KeyEvent e) {
|
||||
if (e.getKeyCode() == KeyEvent.VK_ENTER) {
|
||||
getButton(OK).doClick();
|
||||
} else if (e.getKeyCode() == KeyEvent.VK_ESCAPE) {
|
||||
getButton(CANCEL).doClick();
|
||||
}
|
||||
}
|
||||
});
|
||||
editorPanel.add(editor, gbc);
|
||||
|
||||
@Override
|
||||
public void keyPressed(KeyEvent e) {
|
||||
if (e.getKeyCode() == KeyEvent.VK_ENTER) {
|
||||
getButton(OK).doClick();
|
||||
} else if (e.getKeyCode() == KeyEvent.VK_ESCAPE) {
|
||||
getButton(CANCEL).doClick();
|
||||
if (property.isDefaultable()) {
|
||||
gbc.gridx = 2;
|
||||
gbc.fill = GridBagConstraints.NONE;
|
||||
gbc.weightx = 0;
|
||||
|
||||
if (saveDefaults && !property.isReadOnly()) {
|
||||
editorPanel.add(createDefaultCheckBox(property), gbc);
|
||||
}
|
||||
}
|
||||
});
|
||||
editorPanel.add(editor, gbc);
|
||||
|
||||
if (property.isDefaultable()) {
|
||||
gbc.gridx = 2;
|
||||
gbc.fill = GridBagConstraints.NONE;
|
||||
gbc.weightx = 0;
|
||||
|
||||
if (saveDefaults && !property.isReadOnly()) {
|
||||
editorPanel.add(createDefaultCheckBox(property), gbc);
|
||||
}
|
||||
}
|
||||
|
||||
if (property.getName().equalsIgnoreCase("value")) {
|
||||
componentToFocus = editor;
|
||||
}
|
||||
|
||||
// Make value field focused
|
||||
try {
|
||||
if (componentToFocus == null
|
||||
&& property.getGetter().getName().equalsIgnoreCase("getValue")) {
|
||||
|
||||
if (property.getName().equalsIgnoreCase("value")) {
|
||||
componentToFocus = editor;
|
||||
}
|
||||
} catch (Exception e1) {
|
||||
LOG.warn("Could not determine editor component to focus", e1);
|
||||
|
||||
// Make value field focused
|
||||
try {
|
||||
if (componentToFocus == null
|
||||
&& property.getGetter().getName().equalsIgnoreCase("getValue")) {
|
||||
componentToFocus = editor;
|
||||
}
|
||||
} catch (Exception e1) {
|
||||
LOG.warn("Could not determine editor component to focus", e1);
|
||||
}
|
||||
|
||||
gbc.gridy++;
|
||||
} catch (Exception e) {
|
||||
LOG.error("Error creating editor for " + property.getName(), e);
|
||||
}
|
||||
|
||||
gbc.gridy++;
|
||||
}
|
||||
|
||||
return editorPanel;
|
||||
|
||||
Reference in New Issue
Block a user