Skip to content

Commit

Permalink
'#1830 Modify worker to permit items uncheck functionality.
Browse files Browse the repository at this point in the history
  • Loading branch information
patrickdalla committed Sep 5, 2023
1 parent 4b606ea commit da482df
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ public void showSelection(List<LegendItemBlockContainer> selLegends) {
}
}

public void checkEventItems(List<LegendItemBlockContainer> selLegends) {
public void checkEventItems(List<LegendItemBlockContainer> selLegends, boolean check) {
List<LegendItemBlockContainer> selLegendsList = ipedChartPanel.getIpedChartsPanel().getLegendList().getSelectedValuesList();
if (selLegends != null && selLegends.size() > 0) {
LegendItemBlockContainer libc = selLegendsList.get(0);
Expand All @@ -133,8 +133,14 @@ public void checkEventItems(List<LegendItemBlockContainer> selLegends) {
ds.bitSetItems(libc.getSeriesKey().toString(), bs);// set bits of items in serie
}

EventPeriodCheckWorker bsCheck = new EventPeriodCheckWorker(
ipedChartPanel.getIpedChartsPanel().getDomainAxis(), msrp, bs, true);
EventPeriodCheckWorker bsCheck;
if(check) {
bsCheck = new EventPeriodCheckWorker(
ipedChartPanel.getIpedChartsPanel().getDomainAxis(), msrp, bs, true);
}else{
bsCheck = new EventPeriodCheckWorker(
ipedChartPanel.getIpedChartsPanel().getDomainAxis(), msrp, false, bs);
}
bsCheck.execute();
}
}
Expand Down Expand Up @@ -212,10 +218,10 @@ public void actionPerformed(ActionEvent e) {

//IMPORTANT
if (e.getSource() == checkItems) {
checkEventItems(selLegends);
checkEventItems(selLegends, true);
}
if (e.getSource() == uncheckItems) {
unselectEvents(selLegends);
checkEventItems(selLegends, false);
}

if (e.getSource() == selectAll) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,14 @@ public EventPeriodCheckWorker(IpedDateAxis domainAxis, IMultiSearchResultProvide
super(domainAxis, resultsProvider, bs, clearPreviousSelection);
}

public EventPeriodCheckWorker(IpedDateAxis domainAxis, IMultiSearchResultProvider resultsProvider,
boolean highlight, RoaringBitmap bs) {
super(domainAxis, resultsProvider, bs, false);
this.highlight = highlight;
}

@Override
public void processResultsItem(JTable t, int i) {
Boolean checked = (Boolean) t.getModel().getValueAt(i, 1);
t.getModel().setValueAt(highlight, i, 1);
}

Expand Down

0 comments on commit da482df

Please sign in to comment.