本文整理匯總了Java中org.insightech.er.editor.model.StringObjectModel類的典型用法代碼示例。如果您正苦於以下問題:Java StringObjectModel類的具體用法?Java StringObjectModel怎麽用?Java StringObjectModel使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
StringObjectModel類屬於org.insightech.er.editor.model包,在下文中一共展示了StringObjectModel類的14個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getText
import org.insightech.er.editor.model.StringObjectModel; //導入依賴的package包/類
@Override
public String getText(final Object element) {
final TreeNode treeNode = (TreeNode) element;
final Object value = treeNode.getValue();
if (value instanceof DBObject) {
final DBObject dbObject = (DBObject) value;
return dbObject.getName();
} else if (value instanceof StringObjectModel) {
final StringObjectModel object = (StringObjectModel) value;
return object.getName();
} else if (value instanceof TestData) {
final TestData testData = (TestData) value;
return testData.getName();
}
return value.toString();
}
示例2: getText
import org.insightech.er.editor.model.StringObjectModel; //導入依賴的package包/類
@Override
public String getText(Object element) {
TreeNode treeNode = (TreeNode) element;
Object value = treeNode.getValue();
if (value instanceof DBObject) {
DBObject dbObject = (DBObject) value;
return dbObject.getName();
} else if (value instanceof StringObjectModel) {
StringObjectModel object = (StringObjectModel) value;
return object.getName();
} else if (value instanceof TestData) {
TestData testData = (TestData) value;
return testData.getName();
}
return value.toString();
}
示例3: createTopNode
import org.insightech.er.editor.model.StringObjectModel; //導入依賴的package包/類
protected TreeNode createTopNode(String objectType,
List<DBObject> dbObjectList) {
TreeNode treeNode = new TreeNode(new StringObjectModel(
ResourceString.getResourceString("label.object.type."
+ objectType)));
List<TreeNode> objectNodeList = new ArrayList<TreeNode>();
for (DBObject dbObject : dbObjectList) {
TreeNode objectNode = new TreeNode(dbObject);
objectNode.setParent(treeNode);
objectNodeList.add(objectNode);
}
treeNode.setChildren(objectNodeList.toArray(new TreeNode[objectNodeList
.size()]));
return treeNode;
}
示例4: createTreeNodeList
import org.insightech.er.editor.model.StringObjectModel; //導入依賴的package包/類
protected List<TreeNode> createTreeNodeList() {
List<TreeNode> treeNodeList = new ArrayList<TreeNode>();
TreeNode topNode = new TreeNode(new StringObjectModel(
ResourceString.getResourceString("label.schema")));
treeNodeList.add(topNode);
List<TreeNode> schemaNodeList = new ArrayList<TreeNode>();
for (String schemaName : schemaList) {
TreeNode schemaNode = new TreeNode(schemaName);
schemaNode.setParent(topNode);
schemaNodeList.add(schemaNode);
}
topNode.setChildren(schemaNodeList.toArray(new TreeNode[schemaNodeList
.size()]));
return treeNodeList;
}
示例5: createTreeNodeList
import org.insightech.er.editor.model.StringObjectModel; //導入依賴的package包/類
protected List<TreeNode> createTreeNodeList() {
List<TreeNode> treeNodeList = new ArrayList<TreeNode>();
TreeNode topNode = new TreeNode(new StringObjectModel(
ResourceString.getResourceString("label.testdata")));
treeNodeList.add(topNode);
List<TreeNode> nodeList = new ArrayList<TreeNode>();
for (TestData testData : this.testDataList) {
TreeNode objectNode = new TreeNode(testData);
objectNode.setParent(topNode);
nodeList.add(objectNode);
}
topNode.setChildren(nodeList.toArray(new TreeNode[nodeList.size()]));
return treeNodeList;
}
示例6: generate
import org.insightech.er.editor.model.StringObjectModel; //導入依賴的package包/類
/**
* {@inheritDoc}
*/
@Override
public void generate(ProgressMonitor monitor, HSSFWorkbook workbook,
int sheetNo, boolean useLogicalNameAsSheetName,
Map<String, Integer> sheetNameMap,
Map<String, ObjectModel> sheetObjectMap, ERDiagram diagram,
Map<String, LoopDefinition> loopDefinitionMap)
throws InterruptedException {
String sheetName = this.getSheetName();
HSSFSheet newSheet = createNewSheet(workbook, sheetNo, sheetName,
sheetNameMap);
sheetName = workbook.getSheetName(workbook.getSheetIndex(newSheet));
monitor.subTaskWithCounter(sheetName);
sheetObjectMap.put(sheetName, new StringObjectModel(sheetName));
this.setHistoryListData(workbook, newSheet, sheetObjectMap, diagram);
monitor.worked(1);
}
示例7: createTopNode
import org.insightech.er.editor.model.StringObjectModel; //導入依賴的package包/類
protected TreeNode createTopNode(final String objectType, final List<DBObject> dbObjectList) {
final TreeNode treeNode = new TreeNode(new StringObjectModel(ResourceString.getResourceString("label.object.type." + objectType)));
final List<TreeNode> objectNodeList = new ArrayList<TreeNode>();
for (final DBObject dbObject : dbObjectList) {
final TreeNode objectNode = new TreeNode(dbObject);
objectNode.setParent(treeNode);
objectNodeList.add(objectNode);
}
treeNode.setChildren(objectNodeList.toArray(new TreeNode[objectNodeList.size()]));
return treeNode;
}
示例8: createTreeNodeList
import org.insightech.er.editor.model.StringObjectModel; //導入依賴的package包/類
protected List<TreeNode> createTreeNodeList() {
final List<TreeNode> treeNodeList = new ArrayList<TreeNode>();
TreeNode topNode = new TreeNode(new StringObjectModel(ResourceString.getResourceString("label.schema")));
treeNodeList.add(topNode);
final List<TreeNode> schemaNodeList = new ArrayList<TreeNode>();
for (final Map.Entry<String, List<DBObject>> entry : dbObjectSet.getSchemaDbObjectListMap().entrySet()) {
String schemaName = entry.getKey();
if ("".equals(schemaName)) {
schemaName = ResourceString.getResourceString("label.none");
}
final TreeNode schemaNode = new TreeNode(new StringObjectModel(schemaName));
schemaNode.setParent(topNode);
schemaNodeList.add(schemaNode);
final List<DBObject> dbObjectList = entry.getValue();
final TreeNode[] objectTypeNodes = new TreeNode[DBObject.ALL_TYPES.length];
for (int i = 0; i < DBObject.ALL_TYPES.length; i++) {
objectTypeNodes[i] = new TreeNode(new StringObjectModel(ResourceString.getResourceString("label.object.type." + DBObject.ALL_TYPES[i])));
final List<TreeNode> objectNodeList = new ArrayList<TreeNode>();
for (final DBObject dbObject : dbObjectList) {
if (DBObject.ALL_TYPES[i].equals(dbObject.getType())) {
final TreeNode objectNode = new TreeNode(dbObject);
objectNode.setParent(objectTypeNodes[i]);
objectNodeList.add(objectNode);
}
}
objectTypeNodes[i].setChildren(objectNodeList.toArray(new TreeNode[objectNodeList.size()]));
}
schemaNode.setChildren(objectTypeNodes);
}
topNode.setChildren(schemaNodeList.toArray(new TreeNode[schemaNodeList.size()]));
topNode = createTopNode(DBObject.TYPE_TABLESPACE, dbObjectSet.getTablespaceList());
treeNodeList.add(topNode);
return treeNodeList;
}
示例9: createTreeNodeList
import org.insightech.er.editor.model.StringObjectModel; //導入依賴的package包/類
protected List<TreeNode> createTreeNodeList() {
final List<TreeNode> treeNodeList = new ArrayList<TreeNode>();
final TreeNode topNode = new TreeNode(new StringObjectModel(ResourceString.getResourceString("label.schema")));
treeNodeList.add(topNode);
final List<TreeNode> schemaNodeList = new ArrayList<TreeNode>();
for (final String schemaName : schemaList) {
final TreeNode schemaNode = new TreeNode(schemaName);
schemaNode.setParent(topNode);
schemaNodeList.add(schemaNode);
}
topNode.setChildren(schemaNodeList.toArray(new TreeNode[schemaNodeList.size()]));
return treeNodeList;
}
示例10: createTreeNodeList
import org.insightech.er.editor.model.StringObjectModel; //導入依賴的package包/類
protected List<TreeNode> createTreeNodeList() {
final List<TreeNode> treeNodeList = new ArrayList<TreeNode>();
final TreeNode topNode = new TreeNode(new StringObjectModel(ResourceString.getResourceString("label.testdata")));
treeNodeList.add(topNode);
final List<TreeNode> nodeList = new ArrayList<TreeNode>();
for (final TestData testData : testDataList) {
final TreeNode objectNode = new TreeNode(testData);
objectNode.setParent(topNode);
nodeList.add(objectNode);
}
topNode.setChildren(nodeList.toArray(new TreeNode[nodeList.size()]));
return treeNodeList;
}
示例11: createSheetFromTemplate
import org.insightech.er.editor.model.StringObjectModel; //導入依賴的package包/類
private void createSheetFromTemplate(final ProgressMonitor monitor, final HSSFWorkbook workbook, final ERDiagram diagram, final boolean useLogicalNameAsSheetName) throws InterruptedException {
initSheetNameMap(workbook);
int originalSheetNum = workbook.getNumberOfSheets();
int sheetIndexSheetNo = -1;
while (originalSheetNum > 0) {
final String templateSheetName = workbook.getSheetName(0);
final AbstractSheetGenerator sheetGenerator = getSheetGenerator(templateSheetName);
if (sheetGenerator != null) {
sheetGenerator.generate(monitor, workbook, 0, useLogicalNameAsSheetName, sheetNameMap, sheetObjectMap, diagram, loopDefinitionMap);
workbook.removeSheetAt(0);
} else {
if (!isExcludeTarget(templateSheetName)) {
moveSheet(workbook, 0);
final HSSFSheet sheet = workbook.getSheetAt(workbook.getNumberOfSheets() - 1);
sheetObjectMap.put(templateSheetName, new StringObjectModel(templateSheetName));
if (pictureSheetGenerator != null) {
pictureSheetGenerator.setImage(workbook, sheet);
}
if (sheetIndexSheetGenerator.getTemplateSheetName().equals(templateSheetName)) {
sheetIndexSheetNo = workbook.getNumberOfSheets() - originalSheetNum;
String name = sheetIndexSheetGenerator.getSheetName();
name = AbstractSheetGenerator.decideSheetName(name, sheetNameMap);
monitor.subTaskWithCounter(name);
workbook.setSheetName(workbook.getNumberOfSheets() - 1, name);
} else {
monitor.subTaskWithCounter(sheet.getSheetName());
}
} else {
monitor.subTaskWithCounter("Removing template sheet");
workbook.removeSheetAt(0);
}
monitor.worked(1);
}
originalSheetNum--;
}
if (sheetIndexSheetNo != -1) {
sheetIndexSheetGenerator.generate(monitor, workbook, sheetIndexSheetNo, useLogicalNameAsSheetName, sheetNameMap, sheetObjectMap, diagram, loopDefinitionMap);
}
}
示例12: generate
import org.insightech.er.editor.model.StringObjectModel; //導入依賴的package包/類
/**
* {@inheritDoc}
*/
@Override
public void generate(final ProgressMonitor monitor, final HSSFWorkbook workbook, final int sheetNo, final boolean useLogicalNameAsSheetName, final Map<String, Integer> sheetNameMap, final Map<String, ObjectModel> sheetObjectMap, final ERDiagram diagram, final Map<String, LoopDefinition> loopDefinitionMap) throws InterruptedException {
String sheetName = getSheetName();
final HSSFSheet newSheet = createNewSheet(workbook, sheetNo, sheetName, sheetNameMap);
sheetName = workbook.getSheetName(workbook.getSheetIndex(newSheet));
monitor.subTaskWithCounter(sheetName);
sheetObjectMap.put(sheetName, new StringObjectModel(sheetName));
setHistoryListData(workbook, newSheet, sheetObjectMap, diagram);
monitor.worked(1);
}
示例13: createTreeNodeList
import org.insightech.er.editor.model.StringObjectModel; //導入依賴的package包/類
protected List<TreeNode> createTreeNodeList() {
List<TreeNode> treeNodeList = new ArrayList<TreeNode>();
TreeNode topNode = new TreeNode(new StringObjectModel(
ResourceString.getResourceString("label.schema")));
treeNodeList.add(topNode);
List<TreeNode> schemaNodeList = new ArrayList<TreeNode>();
for (Map.Entry<String, List<DBObject>> entry : dbObjectSet
.getSchemaDbObjectListMap().entrySet()) {
String schemaName = entry.getKey();
if ("".equals(schemaName)) {
schemaName = ResourceString.getResourceString("label.none");
}
TreeNode schemaNode = new TreeNode(
new StringObjectModel(schemaName));
schemaNode.setParent(topNode);
schemaNodeList.add(schemaNode);
List<DBObject> dbObjectList = entry.getValue();
TreeNode[] objectTypeNodes = new TreeNode[DBObject.ALL_TYPES.length];
for (int i = 0; i < DBObject.ALL_TYPES.length; i++) {
objectTypeNodes[i] = new TreeNode(new StringObjectModel(
ResourceString.getResourceString("label.object.type."
+ DBObject.ALL_TYPES[i])));
List<TreeNode> objectNodeList = new ArrayList<TreeNode>();
for (DBObject dbObject : dbObjectList) {
if (DBObject.ALL_TYPES[i].equals(dbObject.getType())) {
TreeNode objectNode = new TreeNode(dbObject);
objectNode.setParent(objectTypeNodes[i]);
objectNodeList.add(objectNode);
}
}
objectTypeNodes[i].setChildren(objectNodeList
.toArray(new TreeNode[objectNodeList.size()]));
}
schemaNode.setChildren(objectTypeNodes);
}
topNode.setChildren(schemaNodeList.toArray(new TreeNode[schemaNodeList
.size()]));
topNode = createTopNode(DBObject.TYPE_TABLESPACE,
this.dbObjectSet.getTablespaceList());
treeNodeList.add(topNode);
return treeNodeList;
}
示例14: createSheetFromTemplate
import org.insightech.er.editor.model.StringObjectModel; //導入依賴的package包/類
private void createSheetFromTemplate(ProgressMonitor monitor,
HSSFWorkbook workbook, ERDiagram diagram,
boolean useLogicalNameAsSheetName) throws InterruptedException {
this.initSheetNameMap(workbook);
int originalSheetNum = workbook.getNumberOfSheets();
int sheetIndexSheetNo = -1;
while (originalSheetNum > 0) {
String templateSheetName = workbook.getSheetName(0);
AbstractSheetGenerator sheetGenerator = this
.getSheetGenerator(templateSheetName);
if (sheetGenerator != null) {
sheetGenerator.generate(monitor, workbook, 0,
useLogicalNameAsSheetName, this.sheetNameMap,
this.sheetObjectMap, diagram, loopDefinitionMap);
workbook.removeSheetAt(0);
} else {
if (!isExcludeTarget(templateSheetName)) {
moveSheet(workbook, 0);
HSSFSheet sheet = workbook.getSheetAt(workbook
.getNumberOfSheets() - 1);
this.sheetObjectMap.put(templateSheetName,
new StringObjectModel(templateSheetName));
if (this.pictureSheetGenerator != null) {
this.pictureSheetGenerator.setImage(workbook, sheet);
}
if (this.sheetIndexSheetGenerator.getTemplateSheetName()
.equals(templateSheetName)) {
sheetIndexSheetNo = workbook.getNumberOfSheets()
- originalSheetNum;
String name = this.sheetIndexSheetGenerator
.getSheetName();
name = AbstractSheetGenerator.decideSheetName(name,
sheetNameMap);
monitor.subTaskWithCounter(name);
workbook.setSheetName(workbook.getNumberOfSheets() - 1,
name);
} else {
monitor.subTaskWithCounter(sheet.getSheetName());
}
} else {
monitor.subTaskWithCounter("Removing template sheet");
workbook.removeSheetAt(0);
}
monitor.worked(1);
}
originalSheetNum--;
}
if (sheetIndexSheetNo != -1) {
this.sheetIndexSheetGenerator.generate(monitor, workbook,
sheetIndexSheetNo, useLogicalNameAsSheetName,
this.sheetNameMap, this.sheetObjectMap, diagram,
loopDefinitionMap);
}
}