-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mass convert #33
base: devel
Are you sure you want to change the base?
Mass convert #33
Conversation
Still a few interface related problems need to be fixed, but functionality for mass conversion is done.
Mass convert for MOS v1 works well, but some bugs still exist. MOS v2 still needs to be tested.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've not checked code in the IDE yet. As I see you mostly move large amounts of code to another place. Unfortunately, GitHub interface don't allow to notice that clearly. I recommend in this case make special commits that just moves existing code with minimal and absolutely necessary changes to facilitate reviewers work. So, can you rebase your changes to follow that suggestion?
You change a GUI in this PR. Can you attach a screenshot or two (before/after) with the notable differences highlighted?
} | ||
return this; | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There a several files without newline in the end. I think, it is better to have it.
@@ -0,0 +1,44 @@ | |||
package org.infinity.gui; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a license header as in the other files
@@ -0,0 +1,44 @@ | |||
package org.infinity.gui; | |||
|
|||
import javax.swing.*; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is better to avoid wildcard imports. They can unexpectedly stop working in new Java versions, because new classes can be added to the packages.
/** | ||
* Creates a JProgressBar with the range 0,100. | ||
*/ | ||
public ProgressCellRenderer(){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use consistent code style -- space between braces
int index = sValue.indexOf('%'); | ||
if (index != -1) { | ||
int p = 0; | ||
try{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Style again
@@ -746,36 +776,36 @@ private void init() | |||
bOutputV2 = new JButton("..."); | |||
bOutputV2.addActionListener(this); | |||
c = ViewerUtil.setGBC(c, 0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.LINE_START, | |||
GridBagConstraints.NONE, new Insets(0, 4, 0, 0), 0, 0); | |||
GridBagConstraints.NONE, new Insets(0, 4, 0, 0), 0, 0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here and below: seems to be unnecessary whitespace-only change
// c = ViewerUtil.setGBC(c, 0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.LINE_START, | ||
// GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0); | ||
// pButtons.add(cbCloseOnExit, c); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove unused code instead of commenting it
for(String outPutTableFiles : getTableInputPaths()) { | ||
Path file = FileManager.resolve(outPutTableFiles); | ||
if(!Files.isRegularFile(file)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Spaces
for(String outPutTableFiles : getTableInputPaths()) { | |
Path file = FileManager.resolve(outPutTableFiles); | |
if(!Files.isRegularFile(file)) { | |
for (String outPutTableFiles : getTableInputPaths()) { | |
Path file = FileManager.resolve(outPutTableFiles); | |
if (!Files.isRegularFile(file)) { |
for(File fileSelected : filePaths) { | ||
System.out.println(fileSelected.getName()); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use Logger
or remove
for(File fileSelected : filePaths) { | |
System.out.println(fileSelected.getName()); | |
} | |
for (File fileSelected : filePaths) { | |
System.out.println(fileSelected.getName()); | |
} |
ArrayList<String> list = new ArrayList<>(); | ||
if(tfOutputTableV1.getModel().getRowCount() > 0) { | ||
for (int i = 0; i < tfOutputTableV1.getModel().getRowCount(); i++) { | ||
list.add(tfOutputTableV1.getModel().getValueAt(i, 0).toString()); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At least you can do that:
ArrayList<String> list = new ArrayList<>(); | |
if(tfOutputTableV1.getModel().getRowCount() > 0) { | |
for (int i = 0; i < tfOutputTableV1.getModel().getRowCount(); i++) { | |
list.add(tfOutputTableV1.getModel().getValueAt(i, 0).toString()); | |
} | |
final int count = tfOutputTableV1.getModel().getRowCount(); | |
if (count > 0) { | |
final ArrayList<String> list = new ArrayList<>(count); | |
for (int i = 0; i < count; i++) { | |
list.add(tfOutputTableV1.getModel().getValueAt(i, 0).toString()); | |
} |
But it is better to use your own TableModel
class which will contain data you need
Here is the GUI before removing the close checkbox. I made this video awhile ago. |
Think I addressed many issues. |
Nice work! However, I've noticed a couple of issues that should be fixed.
And more of an aesthetic issue, the content of the "PVRZ-based" tab would probably look better if it were aligned at the top. |
I think we are in a good spot now. Let me know what you think. |
It works nicely now! I'd like to make three more suggestions though:
|
I've added the ability to mass-convert MOS types.