Issue #1118 Loading characters through ImportAssets - show as readonly

icon
This commit is contained in:
Jindra Petřík
2016-01-03 22:25:54 +01:00
parent c069d5e0e4
commit c2aba5fc08
21 changed files with 2325 additions and 2183 deletions

View File

@@ -24,6 +24,7 @@ import com.jpexs.decompiler.flash.helpers.HighlightedText;
import com.jpexs.decompiler.flash.helpers.hilight.HighlightSpecialType;
import com.jpexs.decompiler.flash.helpers.hilight.Highlighting;
import com.jpexs.decompiler.flash.tags.DefineEditTextTag;
import com.jpexs.decompiler.flash.tags.Tag;
import com.jpexs.decompiler.flash.tags.base.FontTag;
import com.jpexs.decompiler.flash.tags.base.MissingCharacterHandler;
import com.jpexs.decompiler.flash.tags.base.TextTag;
@@ -59,6 +60,8 @@ public class TextPanel extends JPanel implements TagEditorPanel {
private final LineMarkedEditorPane textValue;
private final JPanel buttonsPanel;
private final JButton textEditButton;
private final JButton textSaveButton;
@@ -132,7 +135,7 @@ public class TextPanel extends JPanel implements TagEditorPanel {
topPanel.add(textButtonsPanel);
add(topPanel, BorderLayout.NORTH);
JPanel buttonsPanel = new JPanel(new FlowLayout());
buttonsPanel = new JPanel(new FlowLayout());
textEditButton = createButton("button.edit", "edit16", null, e -> editText());
textSaveButton = createButton("button.save", "save16", null, e -> saveText(true));
textCancelButton = createButton("button.cancel", "cancel16", null, e -> cancelText());
@@ -174,6 +177,17 @@ public class TextPanel extends JPanel implements TagEditorPanel {
textValue.setCaretPosition(0);
setModified(false);
setEditText(false);
boolean readOnly = ((Tag) textTag).isReadOnly();
textValue.setEditable(!readOnly);
buttonsPanel.setVisible(!readOnly);
textAlignLeftButton.setVisible(!readOnly);
textAlignCenterButton.setVisible(!readOnly);
textAlignRightButton.setVisible(!readOnly);
textAlignJustifyButton.setVisible(!readOnly);
decreaseTranslateXButton.setVisible(!readOnly);
increaseTranslateXButton.setVisible(!readOnly);
changeCaseButton.setVisible(!readOnly);
undoChangesButton.setVisible(!readOnly);
}
private boolean isModified() {