use of com.ramussoft.chart.QualifierSource in project ramus by Vitaliy-Yakovchuk.
the class ChartSourceSelectPanel method changeSourceForTable.
private void changeSourceForTable() {
Engine engine = framework.getEngine();
QualifierSource source = chartSource.getQualifierSources().get(0);
FilterSource source2 = source.getFilterSources().get(0);
Element element = engine.getElement(Long.parseLong(source2.getValue()));
source.setQualifier(engine.getQualifier(element.getQualifierId()));
source.getElementSources().clear();
ElementSource source3 = chartSource.createElementSource();
source3.setElement(element);
source.getElementSources().add(source3);
source.getFilterSources().clear();
}
use of com.ramussoft.chart.QualifierSource in project ramus by Vitaliy-Yakovchuk.
the class ChartSourceSelectPanel method createRightPanel.
private void createRightPanel() {
if (qualifierView == null)
return;
Qualifier qualifier = qualifierView.getSelectedQualifier();
boolean b = qualifier != null;
if (b) {
framework.setOpenDynamikViewEvent(new ActionEvent(QualifierPlugin.OPEN_QUALIFIER, qualifier));
QualifierSource qualifierSource = null;
for (QualifierSource s : chartSource.getQualifierSources()) {
if (s.getQualifier().equals(qualifier)) {
qualifierSource = s;
break;
}
}
if (qualifierSource == null) {
qualifierSource = chartSource.createQualifierSource();
qualifierSource.setQualifier(qualifier);
chartSource.getQualifierSources().add(qualifierSource);
}
qualifierSelectPanel = new QualifierSourceSelectPanel(framework, qualifier, qualifierSource, (sourceType.getSelectedItem().equals(sourceTypeElements)) ? SelectType.CHECK : SelectType.RADIO);
int dl = pane.getDividerLocation();
pane.setRightComponent(qualifierSelectPanel);
pane.revalidate();
pane.repaint();
pane.setDividerLocation(dl);
}
}
use of com.ramussoft.chart.QualifierSource in project ramus by Vitaliy-Yakovchuk.
the class ChartSourceSelectPanel method saveSelectedElements.
private void saveSelectedElements() {
qualifierSelectPanel.save();
QualifierSource source = qualifierSelectPanel.getQualifierSource();
if (sourceType.getSelectedItem().equals(sourceTypeTable)) {
if (source.getElementSources().size() > 0) {
chartSource.getQualifierSources().clear();
chartSource.getQualifierSources().add(source);
}
}
}
use of com.ramussoft.chart.QualifierSource in project ramus by Vitaliy-Yakovchuk.
the class ChartSourceSelectPanel method addTableAttributes.
private void addTableAttributes() {
Attribute select = null;
List<QualifierSource> sources = chartSource.getQualifierSources();
if (sources.size() > 0) {
QualifierSource source = sources.get(0);
if (source.getQualifier().isSystem())
select = StandardAttributesPlugin.getAttributeForTable(framework.getEngine(), source.getQualifier());
}
for (Attribute attribute : framework.getEngine().getAttributes()) {
if (attribute.getAttributeType().toString().equals("Core.Table")) {
tableAttribute.addItem(attribute);
if (attribute.equals(select))
tableAttribute.setSelectedItem(attribute);
}
}
}
use of com.ramussoft.chart.QualifierSource in project ramus by Vitaliy-Yakovchuk.
the class ChartSourceSelectPanel method save.
public void save() {
if (qualifierSelectPanel != null)
saveSelectedElements();
chartSource.setProperty(SOURCE_TYPE, (sourceType.getSelectedItem().equals(sourceTypeElements)) ? SOURCE_TYPE_ELEMENTS : SOURCE_TYPE_TABLE);
if (sourceType.getSelectedItem().equals(sourceTypeTable)) {
if (chartSource.getQualifierSources().size() > 0) {
QualifierSource source = chartSource.getQualifierSources().get(0);
if (source.getElementSources().size() > 0) {
ElementSource source2 = source.getElementSources().get(0);
source.getFilterSources().clear();
FilterSource filterSource = chartSource.createFilterSource();
Attribute selectedItem = (Attribute) tableAttribute.getSelectedItem();
if (selectedItem != null) {
filterSource.setAttribute(StandardAttributesPlugin.getTableElementIdAttribute(framework.getEngine()));
filterSource.setValue(Long.toString(source2.getElement().getId()));
source.getFilterSources().add(filterSource);
source.setQualifier(StandardAttributesPlugin.getTableQualifierForAttribute(framework.getEngine(), selectedItem));
source.setElementsLoadType(QualifierSource.ELEMENTS_LOAD_TYPE_ALL);
}
}
}
} else {
for (QualifierSource source : chartSource.getQualifierSources()) source.setElementsLoadType(QualifierSource.ELEMENTS_LOAD_TYPE_SELECTED);
}
}
Aggregations