parent
eed466075e
commit
2832140236
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,38 @@
|
|||||||
|
package com.connor.jd.plm.beans;
|
||||||
|
|
||||||
|
public class JG {
|
||||||
|
int row;
|
||||||
|
int times;
|
||||||
|
String jg;
|
||||||
|
|
||||||
|
public JG(int row, int times, String jg) {
|
||||||
|
super();
|
||||||
|
this.row = row;
|
||||||
|
this.times = times;
|
||||||
|
this.jg = jg;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getTimes() {
|
||||||
|
return times;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTimes(int times) {
|
||||||
|
this.times = times;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getJg() {
|
||||||
|
return jg;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setJg(String jg) {
|
||||||
|
this.jg = jg;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getRow() {
|
||||||
|
return row;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRow(int row) {
|
||||||
|
this.row = row;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,7 @@
|
|||||||
|
package com.connor.jd.plm.dialog;
|
||||||
|
|
||||||
|
import javafx.scene.control.Dialog;
|
||||||
|
|
||||||
|
public class MsgDialog extends Dialog<String> {
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,70 @@
|
|||||||
|
package com.connor.jd.plm.table;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class ModelList extends ArrayList<ModelValue> {
|
||||||
|
|
||||||
|
private List<String> disableEdit = new ArrayList<String>();
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean add(ModelValue e) {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
if (!e.isEditable()) {
|
||||||
|
disableEdit.add(e.getRow() + "," + e.getCol());
|
||||||
|
}
|
||||||
|
return super.add(e);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ModelValue getModelValue(int row, int col) {
|
||||||
|
for (ModelValue mv : this) {
|
||||||
|
if (mv.getRow() == row && mv.getCol() == col) {
|
||||||
|
return mv;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ModelValue getModelValueInRange(int row, int col) {
|
||||||
|
int rowStart;
|
||||||
|
int colStart;
|
||||||
|
int rowEnd;
|
||||||
|
int colEnd;
|
||||||
|
for (ModelValue mv : this) {
|
||||||
|
if (mv.isCombine()) {
|
||||||
|
rowStart = mv.getCombineRows()[0];
|
||||||
|
rowEnd = rowStart + mv.getRowSpan() - 1;
|
||||||
|
colStart = mv.getCombineColumns()[0];
|
||||||
|
colEnd = colStart + mv.getColSpan() - 1;
|
||||||
|
if (row >= rowStart && row <= rowEnd && col >= colStart && col <= colEnd) {
|
||||||
|
return mv;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean addDisableEdit(int row, int col) {
|
||||||
|
String str = row + "," + col;
|
||||||
|
if (disableEdit.contains(str)) {
|
||||||
|
disableEdit.add(disableEdit.indexOf(str), str);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
disableEdit.add(str);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean removeDisableEdit(int row, int col) {
|
||||||
|
String str = row + "," + col;
|
||||||
|
if (disableEdit.contains(str)) {
|
||||||
|
disableEdit.remove(disableEdit.indexOf(str));
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isDisableEdit(int row, int col) {
|
||||||
|
return disableEdit.contains(row + "," + col);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,163 @@
|
|||||||
|
package com.connor.jd.plm.table;
|
||||||
|
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
|
public class ModelValue {
|
||||||
|
|
||||||
|
private String value;
|
||||||
|
private boolean isProp;
|
||||||
|
private int row;
|
||||||
|
private int col;
|
||||||
|
private boolean editable;
|
||||||
|
private int[] combineRows;
|
||||||
|
private int rowSpan;
|
||||||
|
private int[] combineColumns;
|
||||||
|
private int colSpan;
|
||||||
|
|
||||||
|
public ModelValue(String value, boolean isProp, int row, int col, boolean editable, int[] combineRows,
|
||||||
|
int[] combineColumns, String type) {
|
||||||
|
super();
|
||||||
|
this.value = value;
|
||||||
|
this.isProp = isProp;
|
||||||
|
this.row = row;
|
||||||
|
this.col = col;
|
||||||
|
this.editable = editable;
|
||||||
|
this.combineRows = combineRows;
|
||||||
|
this.combineColumns = combineColumns;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ModelValue(boolean editable, int[] combineRows, int[] combineColumns) {
|
||||||
|
super();
|
||||||
|
this.editable = editable;
|
||||||
|
this.combineRows = combineRows;
|
||||||
|
this.combineColumns = combineColumns;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ModelValue(String value, boolean isProp, int row, int col, boolean editable) {
|
||||||
|
super();
|
||||||
|
this.value = value;
|
||||||
|
this.isProp = isProp;
|
||||||
|
this.row = row;
|
||||||
|
this.col = col;
|
||||||
|
this.editable = editable;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ModelValue(String value, boolean isProp, int row, int col, boolean editable, int[] combineRows,
|
||||||
|
int[] combineColumns) {
|
||||||
|
super();
|
||||||
|
this.value = value;
|
||||||
|
this.isProp = isProp;
|
||||||
|
this.row = row;
|
||||||
|
this.col = col;
|
||||||
|
this.editable = editable;
|
||||||
|
this.combineRows = combineRows;
|
||||||
|
this.combineColumns = combineColumns;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ModelValue(String value, boolean isProp, int row, int col, boolean editable, int rowStart, int rowEnd,
|
||||||
|
int colStart, int colEnd) {
|
||||||
|
super();
|
||||||
|
this.value = value;
|
||||||
|
this.isProp = isProp;
|
||||||
|
this.row = row;
|
||||||
|
this.col = col;
|
||||||
|
this.editable = editable;
|
||||||
|
setCombineRows(rowStart, rowEnd);
|
||||||
|
setCombineColumns(colStart, colEnd);
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getValue() {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setValue(String value) {
|
||||||
|
this.value = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getRow() {
|
||||||
|
return row;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRow(int row) {
|
||||||
|
this.row = row;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getCol() {
|
||||||
|
return col;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCol(int col) {
|
||||||
|
this.col = col;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isEditable() {
|
||||||
|
return editable;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEditable(boolean editable) {
|
||||||
|
this.editable = editable;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int[] getCombineRows() {
|
||||||
|
return combineRows;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCombineRows(int[] combineRows) {
|
||||||
|
this.rowSpan = combineRows.length;
|
||||||
|
this.combineRows = combineRows;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCombineRows(int start, int end) {
|
||||||
|
if (start <= end) {
|
||||||
|
this.rowSpan = end - start + 1;
|
||||||
|
this.combineRows = new int[rowSpan];
|
||||||
|
for (int i = 0; i < rowSpan; i++) {
|
||||||
|
combineRows[i] = start + i;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public int[] getCombineColumns() {
|
||||||
|
return combineColumns;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCombineColumns(int[] combineColumns) {
|
||||||
|
this.colSpan = combineColumns.length;
|
||||||
|
this.combineColumns = combineColumns;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCombineColumns(int start, int end) {
|
||||||
|
if (start <= end) {
|
||||||
|
this.colSpan = end - start + 1;
|
||||||
|
this.combineColumns = new int[colSpan];
|
||||||
|
for (int i = 0; i < colSpan; i++) {
|
||||||
|
combineColumns[i] = start + i;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getRowSpan() {
|
||||||
|
return rowSpan;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getColSpan() {
|
||||||
|
return colSpan;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isProp() {
|
||||||
|
return isProp;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setProp(boolean isProp) {
|
||||||
|
this.isProp = isProp;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean hasValue() {
|
||||||
|
return Objects.nonNull(value);
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isCombine() {
|
||||||
|
return rowSpan != 0 && colSpan != 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in new issue