Skip to content

Commit

Permalink
NyarNftGenAppの不具合を修正
Browse files Browse the repository at this point in the history
  • Loading branch information
nyatla committed May 17, 2016
1 parent b640eaa commit a13c26d
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 10 deletions.
2 changes: 1 addition & 1 deletion lib/src/jp/nyatla/nyartoolkit/core/NyARVersion.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public class NyARVersion
/**マイナバージョン*/
public final static int VERSION_MINOR=0;
/**タグ*/
public final static int VERSION_TAG=6;
public final static int VERSION_TAG=7;
/**バージョン文字列*/
public final static String VERSION_STRING=MODULE_NAME+"/"+VERSION_MAJOR+"."+VERSION_MINOR+"."+VERSION_TAG;
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@
import java.awt.geom.AffineTransform;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;

import jp.nyatla.nyartoolkit.apps.nftfilegen.cmd.FileOpen;
import jp.nyatla.nyartoolkit.apps.nftfilegen.cmd.MakeFeature;
import jp.nyatla.nyartoolkit.core.NyARVersion;
import jp.nyatla.nyartoolkit.core.marker.nft.NyARNftFreakFsetFile;

import jp.nyatla.nyartoolkit.core.marker.nft.NyARNftFsetFile.NyAR2FeatureCoord;
Expand All @@ -56,6 +56,7 @@
import javax.swing.JMenuItem;
import javax.swing.JMenuBar;


public class NyarNftGenApp extends JFrame {

private static final long serialVersionUID = -431750214737784092L;
Expand Down Expand Up @@ -194,7 +195,7 @@ public void actionPerformed(ActionEvent e) {
JOptionPane.showMessageDialog(null, "Make feature set before to export.");
return;
}
File fp=_cmd_fp.openFile();
File fp=_cmd_fp.saveFile();
try {
saveToFile(fp.getAbsoluteFile()+".iset",_last_result.iset.makeIsetBinary());
saveToFile(fp.getAbsoluteFile()+".fset",_last_result.fset.makeFsetBinary());
Expand All @@ -206,6 +207,22 @@ public void actionPerformed(ActionEvent e) {
});
mnExport.add(mntmNewMenuItem_1);

JMenuItem mntmNewMenuItem_2 = new JMenuItem("Save PackedNftFile");
mntmNewMenuItem_2.setEnabled(false);
mnExport.add(mntmNewMenuItem_2);

JMenu mnNewMenu = new JMenu("Help");
menuBar.add(mnNewMenu);

JMenuItem mntmNewMenuItem_3 = new JMenuItem("About");
mntmNewMenuItem_3.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
JOptionPane.showMessageDialog(null,String.format("NyarNftgenApp \n%s",NyARVersion.VERSION_STRING));
}
});
mnNewMenu.add(mntmNewMenuItem_3);


JPanel sub_panel = new JPanel();
sub_panel.setBorder(new EtchedBorder(EtchedBorder.LOWERED, null, null));
getContentPane().add(sub_panel, BorderLayout.EAST);
Expand Down Expand Up @@ -346,13 +363,13 @@ public void onFinished(MakeFeature.Result i_result) {
JLabel lblNewLabel = new JLabel("Iset DPIs");
sub_panel.add(lblNewLabel, "1, 9");

JComboBox isetdpi_cmb = new JComboBox();
JComboBox<String> isetdpi_cmb = new JComboBox<String>();
isetdpi_cmb.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
_subdpi_text.setEnabled(_fsetlv_cmb.getSelectedIndex()==1);
}
});
isetdpi_cmb.setModel(new DefaultComboBoxModel(new String[] {"Auto", "Custom"}));
isetdpi_cmb.setModel(new DefaultComboBoxModel<String>(new String[] {"Auto", "Custom"}));
sub_panel.add(isetdpi_cmb, "1, 11, fill, default");
this._isetdpi_cmb=isetdpi_cmb;

Expand All @@ -366,12 +383,12 @@ public void actionPerformed(ActionEvent e) {
JLabel lblFsetParametor = new JLabel("FSET parametor");
sub_panel.add(lblFsetParametor, "1, 15");

JComboBox fsetlv_cmb = new JComboBox();
JComboBox<String> fsetlv_cmb = new JComboBox<String>();
fsetlv_cmb.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
}
});
fsetlv_cmb.setModel(new DefaultComboBoxModel(new String[] {"Subset LV1", "Subset LV2", "Subset LV3", "Subset LV4"}));
fsetlv_cmb.setModel(new DefaultComboBoxModel<String>(new String[] {"Subset LV1", "Subset LV2", "Subset LV3", "Subset LV4"}));
fsetlv_cmb.setSelectedIndex(1);
sub_panel.add(fsetlv_cmb, "1, 17, fill, default");
this._fsetlv_cmb=fsetlv_cmb;
Expand All @@ -393,8 +410,8 @@ public void actionPerformed(ActionEvent e) {
final PreviewPanel _preview_panel;

final JTextField _subdpi_text;
final JComboBox _fsetlv_cmb;
final JComboBox _isetdpi_cmb;
final JComboBox<String> _fsetlv_cmb;
final JComboBox<String> _isetdpi_cmb;
final JSpinner _dpi_spinner;
final JTextArea _result_text;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,14 @@
import javax.swing.SwingConstants;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import javax.swing.JProgressBar;


public class ProgressDialog extends JDialog {

/**
*
*/
private static final long serialVersionUID = 286204141525247015L;
private final JPanel contentPanel = new JPanel();


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,16 @@ public FileOpen(Component c)
{
super(c);
}
public File saveFile()
{
JFileChooser filechooser = new JFileChooser();
int selected = filechooser.showSaveDialog(this._parent);
if (selected == JFileChooser.APPROVE_OPTION){
return filechooser.getSelectedFile();
}else{
return null;
}
}
public File openFile()
{
JFileChooser filechooser = new JFileChooser();
Expand Down

0 comments on commit a13c26d

Please sign in to comment.