Skip to content

Commit

Permalink
Release 0.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
hajdam committed Apr 13, 2019
1 parent f531280 commit 28a19c2
Show file tree
Hide file tree
Showing 12 changed files with 34 additions and 41 deletions.
5 changes: 2 additions & 3 deletions changes.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
0.2.0
0.2.0 (2019-04-13)
- Renamed to BinEd
- Updated to newer version of library
- Support for half-size space
- Support for layout, theme and colors profiles
- Added support for different numerical types in status bar
- Context aware popup menu
- Added support for different numerical bases in status bar

0.1.7 (2017-10-10)
- Values panel made editable
Expand Down
Binary file modified images/bined-screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/org/exbin/bined/netbeans/BinaryEditorTopComponent.java
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@
import org.exbin.framework.gui.about.panel.AboutPanel;
import org.exbin.framework.gui.utils.WindowUtils.DialogWrapper;
import org.exbin.framework.gui.utils.panel.CloseControlPanel;
import org.netbeans.api.queries.FileEncodingQuery;
import org.openide.util.NbPreferences;

/**
Expand Down Expand Up @@ -717,6 +716,7 @@ private JPopupMenu createContextMenu(int x, int y) {
}
if (actionType != OptionsControlHandler.ControlActionType.CANCEL) {
setApplyOptions(optionsPanel.getApplyOptions());
encodingsHandler.setEncodings(optionsPanel.getApplyOptions().getCharsetOptions().getEncodings());
codeArea.repaint();
}

Expand Down
6 changes: 3 additions & 3 deletions src/org/exbin/bined/netbeans/Bundle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ HINT_BinaryEditorTopComponent=This is a BinaryEditor window
Application.name = BinEd - Binary/Hexadecimal Editor
Application.title = BinEd NetBeans Plugin
Application.release = 0.2.0
Application.mode = DEV
Application.version = 0.2.0 DEV
Application.product= BinEd Binary/Hexadecimal Editor 0.2.0 DEV
Application.mode =
Application.version = 0.2.0
Application.product= BinEd Binary/Hexadecimal Editor 0.2.0
Application.vendor = ExBin Project
Application.homepage = https://bined.exbin.org/netbeans-plugin/
Application.vendorId = ExBin Project
Expand Down
7 changes: 6 additions & 1 deletion src/org/exbin/bined/netbeans/GoToPositionAction.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import java.util.ResourceBundle;
import javax.annotation.ParametersAreNonnullByDefault;
import javax.swing.JPanel;
import org.exbin.bined.basic.PositionScrollVisibility;
import org.exbin.bined.swing.extended.ExtCodeArea;
import org.exbin.framework.bined.panel.GoToBinaryPanel;
import org.exbin.framework.gui.utils.LanguageUtils;
Expand All @@ -33,7 +34,7 @@
/**
* Go to handler.
*
* @version 0.2.0 2019/03/22
* @version 0.2.0 2019/04/13
* @author ExBin Project (http://exbin.org)
*/
@ParametersAreNonnullByDefault
Expand All @@ -60,6 +61,10 @@ public void actionPerformed(ActionEvent event) {
if (actionType == DefaultControlHandler.ControlActionType.OK) {
goToPanel.acceptInput();
codeArea.setCaretPosition(goToPanel.getGoToPosition());
PositionScrollVisibility visibility = codeArea.getPainter().computePositionScrollVisibility(codeArea.getCaretPosition());
if (visibility != PositionScrollVisibility.VISIBLE) {
codeArea.centerOnCursor();
}
}

dialog.close();
Expand Down
7 changes: 4 additions & 3 deletions src/org/exbin/bined/netbeans/panel/BinEdOptionsPanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -182,37 +182,38 @@ public void load() {
editorOptions.loadFromParameters(preferences.getEditorParameters());
statusOptions.loadFromParameters(preferences.getStatusParameters());
codeAreaOptions.loadFromParameters(preferences.getCodeAreaParameters());
charsetOptions.loadFromParameters(preferences.getCharsetParameters());

editorParametersPanel.loadFromOptions(editorOptions);
statusParametersPanel.loadFromOptions(statusOptions);
codeAreaParametersPanel.loadFromOptions(codeAreaOptions);
charsetParametersPanel.loadFromOptions(charsetOptions);

charsetOptions.loadFromParameters(preferences.getCharsetParameters());
layoutProfilesPanel.loadFromParameters(preferences.getLayoutParameters());
layoutSelectionPanel.setDefaultProfile(preferences.getLayoutParameters().getSelectedProfile());
colorProfilesPanel.loadFromParameters(preferences.getColorParameters());
colorSelectionPanel.setDefaultProfile(preferences.getColorParameters().getSelectedProfile());
themeProfilesPanel.loadFromParameters(preferences.getThemeParameters());
themeSelectionPanel.setDefaultProfile(preferences.getThemeParameters().getSelectedProfile());
charsetParametersPanel.loadFromPreferences(preferences.getPreferences());
}

public void store() {
editorParametersPanel.saveToOptions(editorOptions);
statusParametersPanel.saveToOptions(statusOptions);
codeAreaParametersPanel.saveToOptions(codeAreaOptions);
charsetParametersPanel.saveToOptions(charsetOptions);

editorOptions.saveToParameters(preferences.getEditorParameters());
statusOptions.saveToParameters(preferences.getStatusParameters());
codeAreaOptions.saveToParameters(preferences.getCodeAreaParameters());
charsetOptions.saveToParameters(preferences.getCharsetParameters());

layoutProfilesPanel.saveToParameters(preferences.getLayoutParameters());
preferences.getLayoutParameters().setSelectedProfile(layoutSelectionPanel.getDefaultProfile());
colorProfilesPanel.saveToParameters(preferences.getColorParameters());
preferences.getColorParameters().setSelectedProfile(colorSelectionPanel.getDefaultProfile());
themeProfilesPanel.saveToParameters(preferences.getThemeParameters());
preferences.getThemeParameters().setSelectedProfile(themeSelectionPanel.getDefaultProfile());
charsetParametersPanel.saveToPreferences(preferences.getPreferences());
}

public void setApplyOptions(BinEdApplyOptions applyOptions) {
Expand Down
15 changes: 0 additions & 15 deletions src/org/exbin/framework/bined/options/CodeAreaOptions.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
import org.exbin.bined.PositionCodeType;
import org.exbin.bined.capability.CodeCharactersCaseCapable;
import org.exbin.bined.capability.CodeTypeCapable;
import org.exbin.bined.capability.RowWrappingCapable;
import org.exbin.bined.capability.RowWrappingCapable.RowWrappingMode;
import org.exbin.bined.capability.ViewModeCapable;
import org.exbin.bined.extended.capability.PositionCodeTypeCapable;
Expand All @@ -44,7 +43,6 @@
public class CodeAreaOptions {

private Font codeFont = null;
private boolean rowWrapping = false;
private CodeType codeType = CodeType.HEXADECIMAL;
private boolean showUnprintables = true;
private CodeCharactersCase codeCharactersCase = CodeCharactersCase.UPPER;
Expand All @@ -68,14 +66,6 @@ public void setCodeFont(Font codeFont) {
this.codeFont = codeFont;
}

public boolean isRowWrapping() {
return rowWrapping;
}

public void setRowWrapping(boolean rowWrapping) {
this.rowWrapping = rowWrapping;
}

@Nonnull
public CodeType getCodeType() {
return codeType;
Expand Down Expand Up @@ -171,7 +161,6 @@ public void setMaxRowPositionLength(int maxRowPositionLength) {

public void loadFromParameters(CodeAreaParameters parameters) {
codeFont = parameters.getCodeFont(DEFAULT_FONT);
rowWrapping = parameters.isRowWrapping();
codeType = parameters.getCodeType();
showUnprintables = parameters.isShowNonprintables();
codeCharactersCase = parameters.getCodeCharactersCase();
Expand All @@ -187,7 +176,6 @@ public void loadFromParameters(CodeAreaParameters parameters) {

public void saveToParameters(CodeAreaParameters parameters) {
parameters.setCodeFont(codeFont);
parameters.setRowWrapping(rowWrapping);
parameters.setCodeType(codeType);
parameters.setShowUnprintables(showUnprintables);
parameters.setCodeCharactersCase(codeCharactersCase);
Expand All @@ -203,7 +191,6 @@ public void saveToParameters(CodeAreaParameters parameters) {

public void applyFromCodeArea(ExtCodeArea codeArea) {
codeFont = ((FontCapable) codeArea).getCodeFont();
rowWrapping = ((RowWrappingCapable) codeArea).getRowWrapping() == RowWrappingMode.WRAPPING;
codeType = ((CodeTypeCapable) codeArea).getCodeType();
showUnprintables = ((ShowUnprintablesCapable) codeArea).isShowUnprintables();
codeCharactersCase = ((CodeCharactersCaseCapable) codeArea).getCodeCharactersCase();
Expand All @@ -218,7 +205,6 @@ public void applyFromCodeArea(ExtCodeArea codeArea) {

public void applyToCodeArea(ExtCodeArea codeArea) {
((FontCapable) codeArea).setCodeFont(useDefaultFont ? DEFAULT_FONT : codeFont);
((RowWrappingCapable) codeArea).setRowWrapping(rowWrapping ? RowWrappingMode.WRAPPING : RowWrappingMode.NO_WRAPPING);
((CodeTypeCapable) codeArea).setCodeType(codeType);
((ShowUnprintablesCapable) codeArea).setShowUnprintables(showUnprintables);
((CodeCharactersCaseCapable) codeArea).setCodeCharactersCase(codeCharactersCase);
Expand All @@ -233,7 +219,6 @@ public void applyToCodeArea(ExtCodeArea codeArea) {

public void setOptions(CodeAreaOptions codeAreaOptions) {
codeFont = codeAreaOptions.codeFont;
rowWrapping = codeAreaOptions.rowWrapping;
codeType = codeAreaOptions.codeType;
showUnprintables = codeAreaOptions.showUnprintables;
codeCharactersCase = codeAreaOptions.codeCharactersCase;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import org.exbin.bined.CodeCharactersCase;
import org.exbin.bined.CodeType;
import org.exbin.bined.PositionCodeType;
import org.exbin.bined.capability.RowWrappingCapable;
import org.exbin.framework.bined.options.CodeAreaOptions;
import org.exbin.framework.editor.text.panel.TextFontPanel;
import org.exbin.framework.gui.utils.LanguageUtils;
Expand Down Expand Up @@ -58,7 +59,7 @@ public void saveToOptions(CodeAreaOptions options) {
options.setViewMode(CodeAreaViewMode.valueOf((String) viewModeComboBox.getSelectedItem()));
options.setCodeColorization(codeColorizationCheckBox.isSelected());
options.setUseDefaultFont(useDefaultFontCheckBox.isSelected());
options.setRowWrapping(rowWrappingModeCheckBox.isSelected());
options.setRowWrappingMode(rowWrappingModeCheckBox.isSelected() ? RowWrappingCapable.RowWrappingMode.WRAPPING : RowWrappingCapable.RowWrappingMode.NO_WRAPPING);
options.setMaxBytesPerRow((Integer) maxBytesPerRowSpinner.getValue());
options.setMinRowPositionLength((Integer) minRowPositionLengthSpinner.getValue());
options.setMaxRowPositionLength((Integer) maxRowPositionLengthSpinner.getValue());
Expand All @@ -75,7 +76,7 @@ public void loadFromOptions(CodeAreaOptions options) {
viewModeComboBox.setSelectedItem(options.getViewMode().name());
codeColorizationCheckBox.setSelected(options.isCodeColorization());
useDefaultFontCheckBox.setSelected(options.isUseDefaultFont());
rowWrappingModeCheckBox.setSelected(options.isRowWrapping());
rowWrappingModeCheckBox.setSelected(options.getRowWrappingMode() == RowWrappingCapable.RowWrappingMode.WRAPPING);
maxBytesPerRowSpinner.setValue(options.getMaxBytesPerRow());
minRowPositionLengthSpinner.setValue(options.getMinRowPositionLength());
maxRowPositionLengthSpinner.setValue(options.getMaxRowPositionLength());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import java.util.List;
import javax.annotation.Nonnull;
import javax.annotation.ParametersAreNonnullByDefault;
import org.exbin.bined.capability.RowWrappingCapable;
import org.exbin.bined.netbeans.FileHandlingMode;
import org.exbin.bined.swing.extended.layout.DefaultExtendedCodeAreaLayoutProfile;
import org.exbin.bined.swing.extended.layout.ExtendedCodeAreaDecorations;
Expand Down Expand Up @@ -63,8 +64,9 @@ public BinaryEditorPreferences(Preferences preferences) {
themeParameters = new ThemeParameters(preferences);
colorParameters = new ColorParameters(preferences);

String storedVersion = preferences.get(PREFERENCES_VERSION, "");
if ("".equals(storedVersion)) {
final String legacyDef = "LEGACY";
String storedVersion = preferences.get(PREFERENCES_VERSION, legacyDef);
if (legacyDef.equals(storedVersion)) {
try {
importLegacyPreferences();
} finally {
Expand Down Expand Up @@ -120,7 +122,7 @@ private void importLegacyPreferences() {
codeAreaParameters.setUseDefaultFont(legacyPreferences.isUseDefaultFont());
codeAreaParameters.setCodeFont(legacyPreferences.getCodeFont(CodeAreaOptions.DEFAULT_FONT));
codeAreaParameters.setCodeType(legacyPreferences.getCodeType());
codeAreaParameters.setRowWrapping(legacyPreferences.isLineWrapping());
codeAreaParameters.setRowWrappingMode(legacyPreferences.isLineWrapping() ? RowWrappingCapable.RowWrappingMode.WRAPPING : RowWrappingCapable.RowWrappingMode.NO_WRAPPING);
codeAreaParameters.setShowUnprintables(legacyPreferences.isShowNonprintables());
codeAreaParameters.setCodeCharactersCase(legacyPreferences.getCodeCharactersCase());
codeAreaParameters.setPositionCodeType(legacyPreferences.getPositionCodeType());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@
public class CodeAreaParameters {

public static final String PREFERENCES_CODE_TYPE = "codeType";
public static final String PREFERENCES_LINE_WRAPPING = "lineWrapping";
public static final String PREFERENCES_SHOW_UNPRINTABLES = "showNonpritables";
public static final String PREFERENCES_ENCODING_SELECTED = "selectedEncoding";
public static final String PREFERENCES_ENCODING_PREFIX = "textEncoding.";
Expand Down Expand Up @@ -167,14 +166,6 @@ public void setCodeFont(Font font) {
}
}

public boolean isRowWrapping() {
return preferences.getBoolean(PREFERENCES_LINE_WRAPPING, false);
}

public void setRowWrapping(boolean rowWrapping) {
preferences.putBoolean(PREFERENCES_LINE_WRAPPING, rowWrapping);
}

@Nonnull
public CodeType getCodeType() {
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ public void setByteGroupSize(int byteGroupSize) {
}

public int getSpaceGroupSize() {
return preferences.getInt(PREFERENCES_BYTE_GROUP_SIZE, 1);
return preferences.getInt(PREFERENCES_SPACE_GROUP_SIZE, 0);
}

public void setSpaceGroupSize(int spaceGroupSize) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener;
import org.exbin.framework.Preferences;
import org.exbin.framework.bined.options.CharsetOptions;
import org.exbin.framework.gui.options.api.OptionsPanel;
import org.exbin.framework.gui.options.api.OptionsPanel.ModifiedOptionListener;
import org.exbin.framework.gui.options.api.OptionsPanel.PathItem;
Expand Down Expand Up @@ -333,6 +334,14 @@ public void saveToPreferences(Preferences preferences) {
}
}

public void loadFromOptions(CharsetOptions charsetOptions) {
setEncodingList(charsetOptions.getEncodings());
}

public void saveToOptions(CharsetOptions charsetOptions) {
charsetOptions.setEncodings(getEncodingList());
}

@Override
public void setModifiedOptionListener(ModifiedOptionListener modifiedOptionListener) {
this.modifiedOptionListener = modifiedOptionListener;
Expand Down

0 comments on commit 28a19c2

Please sign in to comment.