use of com.igormaznitsa.mindmap.swing.panel.utils.KeyShortcut in project netbeans-mmd-plugin by raydac.
the class KeyShortCutEditPanel method updateCurrentSelectedForKey.
private void updateCurrentSelectedForKey(final KeyEvent evt) {
final int index = this.tableKeyShortcuts.getSelectedRow();
if (index >= 0) {
final KeyShortcut oldShortcut = this.listOfKeys.get(index);
final int keyCode = evt.getKeyCode();
final int modifiers = evt.getModifiers() & (KeyEvent.META_MASK | KeyEvent.SHIFT_MASK | KeyEvent.CTRL_MASK | KeyEvent.ALT_MASK);
final KeyShortcut newShortCut = new KeyShortcut(oldShortcut.getID(), keyCode, modifiers);
this.listOfKeys.set(index, newShortCut);
for (final TableModelListener l : this.listeners) {
l.tableChanged(new TableModelEvent(this, index));
}
}
updateForSelected();
}
use of com.igormaznitsa.mindmap.swing.panel.utils.KeyShortcut in project netbeans-mmd-plugin by raydac.
the class KeyShortCutEditPanel method updateCurrentSelectedForKey.
private void updateCurrentSelectedForKey(final KeyEvent evt) {
final int index = this.tableKeyShortcuts.getSelectedRow();
if (index >= 0) {
final KeyShortcut oldShortcut = this.listOfKeys.get(index);
final int keyCode = evt.getKeyCode();
final int modifiers = evt.getModifiers() & (KeyEvent.META_MASK | KeyEvent.SHIFT_MASK | KeyEvent.CTRL_MASK | KeyEvent.ALT_MASK);
final KeyShortcut newShortCut = new KeyShortcut(oldShortcut.getID(), keyCode, modifiers);
this.listOfKeys.set(index, newShortCut);
for (final TableModelListener l : this.listeners) {
l.tableChanged(new TableModelEvent(this, index));
}
}
updateForSelected();
}
use of com.igormaznitsa.mindmap.swing.panel.utils.KeyShortcut in project netbeans-mmd-plugin by raydac.
the class KeyShortCutEditPanel method updateForSelected.
private void updateForSelected() {
final KeyShortcut shortcut = getSelectedRow();
if (shortcut == null) {
this.buttonEditKeyCode.setEnabled(false);
this.buttonEditKeyCode.setSelected(false);
this.checkBoxALT.setSelected(false);
this.checkBoxSHIFT.setSelected(false);
this.checkBoxCTRL.setSelected(false);
this.checkBoxMeta.setSelected(false);
this.checkBoxALT.setEnabled(false);
this.checkBoxCTRL.setEnabled(false);
this.checkBoxSHIFT.setEnabled(false);
this.checkBoxMeta.setEnabled(false);
// NOI18N
this.textFieldKeyCode.setText("");
this.textFieldKeyCode.setEnabled(false);
} else {
this.buttonEditKeyCode.setEnabled(true);
this.buttonEditKeyCode.setSelected(false);
this.textFieldKeyCode.setEnabled(true);
this.checkBoxALT.setEnabled(true);
this.checkBoxCTRL.setEnabled(true);
this.checkBoxMeta.setEnabled(true);
this.checkBoxSHIFT.setEnabled(true);
this.textFieldKeyCode.setText(shortcut.getKeyCodeName());
this.checkBoxALT.setSelected(shortcut.isAlt());
this.checkBoxSHIFT.setSelected(shortcut.isShift());
this.checkBoxMeta.setSelected(shortcut.isMeta());
this.checkBoxCTRL.setSelected(shortcut.isCtrl());
}
}
use of com.igormaznitsa.mindmap.swing.panel.utils.KeyShortcut in project netbeans-mmd-plugin by raydac.
the class MindMapSettingsPanel method makeConfig.
public MindMapPanelConfig makeConfig() {
final MindMapPanelConfig result = new MindMapPanelConfig(this.etalon, false);
result.setPaperColor(this.colorButtonBackgroundColor.getValue());
result.setGridColor(this.colorButtonGridColor.getValue());
result.setCollapsatorBackgroundColor(this.colorButtonCollapsatorFill.getValue());
result.setCollapsatorBorderColor(this.colorButtonCollapsatorBorder.getValue());
result.setConnectorColor(this.colorButtonConnectorColor.getValue());
result.setJumpLinkColor(this.colorButtonJumpLink.getValue());
result.setSelectLineColor(this.colorButtonSelectFrameColor.getValue());
result.setRootBackgroundColor(this.colorButtonRootFill.getValue());
result.setRootTextColor(this.colorButtonRootText.getValue());
result.setFirstLevelBackgroundColor(this.colorButton1stLevelFill.getValue());
result.setFirstLevelTextColor(this.colorButton1stLevelText.getValue());
result.setOtherLevelBackgroundColor(this.colorButton2ndLevelFill.getValue());
result.setOtherLevelTextColor(this.colorButton2ndLevelText.getValue());
result.setGridStep(getInt(this.spinnerGridStep));
result.setConnectorWidth(getFloat(this.spinnerConnectorWidth));
result.setCollapsatorSize(getInt(this.spinnerCollapsatorSize));
result.setCollapsatorBorderWidth(getFloat(this.spinnerCollapsatorWidth));
result.setJumpLinkWidth(getFloat(this.spinnerJumpLinkWidth));
result.setSelectLineWidth(getFloat(this.spinnerSelectionFrameWidth));
result.setSelectLineGap(getInt(this.spinnerSelectionFrameGap));
result.setElementBorderWidth(getFloat(this.spinnerBorderWidth));
result.setShowGrid(this.checkBoxShowGrid.isSelected());
result.setDropShadow(this.checkBoxDropShadow.isSelected());
result.setFirstLevelHorizontalInset(this.slider1stLevelHorzGap.getValue());
result.setFirstLevelVerticalInset(this.slider1stLevelVertGap.getValue());
result.setOtherLevelHorizontalInset(this.slider2ndLevelHorzGap.getValue());
result.setOtherLevelVerticalInset(this.slider2ndLevelVertGap.getValue());
result.setRenderQuality(GetUtils.ensureNonNull((RenderQuality) comboBoxRenderQuality.getSelectedItem(), RenderQuality.DEFAULT));
result.setFont(this.theFont);
final int scaleModifier = (this.checkBoxScalingModifierALT.isSelected() ? KeyEvent.ALT_MASK : 0) | (this.checkBoxScalingModifierCTRL.isSelected() ? KeyEvent.CTRL_MASK : 0) | (this.checkBoxScalingModifierSHFT.isSelected() ? KeyEvent.SHIFT_MASK : 0) | (this.checkBoxScalingModifierMETA.isSelected() ? KeyEvent.META_MASK : 0);
result.setScaleModifiers(scaleModifier);
for (final Map.Entry<String, KeyShortcut> e : this.mapKeyShortCuts.entrySet()) {
result.setKeyShortCut(e.getValue());
}
return result;
}
Aggregations