Forum Replies Created

Viewing 15 posts - 1 through 15 (of 15 total)
  • Author
    Posts
  • Brian
    Participant
    Post count: 21

    I’ll give that a shot now. I did look over the NavigationControlPanel code a bunch. But, I was focused on a call that would get me a singleton to use. I was afraid that creating another instance would cause problems with the UI rendering or listeners.

    Brian
    Participant
    Post count: 21

    I can only guess that I was thinking that clearing the model was not working because I had another problem I had soooo many. Clearing the model makes sense and works. Blasting the whole gantt chart from inside a listener didn’t make much logical sense anyhow, since you would effectively blast the object that you were associated with. Guess that closes this request.

    Brian
    Participant
    Post count: 21
    in reply to: DateLineModelListener #12858 |

    Yes, I got where I needed to be. thanks.

    Brian
    Participant
    Post count: 21
    in reply to: DateLineModelListener #12837 |

    OH, I see. The event has an ID, such as TIME_SPAN_CHANGED. That clears a lot of things up for me!

    Brian
    Participant
    Post count: 21
    in reply to: DateLineModelListener #12836 |

    Also, I see that this listener gets called for all sorts of things, like zooming in on the screen, in addition to just changes in the horizon. Is there a way to distinguish the different types of events from each other? I must be missing something here.

    Brian
    Participant
    Post count: 21
    in reply to: DateLineModelListener #12835 |

    update to:
    2a) final ITimeSpan requestedTimeSpan = event.getRequestedVisibleTimeSpan(); this gives me null times for horizon changes drive from the UI, but I get dates when the change was caused through my code.

    I actually call setVisibleTimeSpan in my code, so I guess I understand why it is getting called with values in those cases, but not all cases.
    However, the crux of the problem still remains, I feel like the method gets called too many times and I dont see a way to compare the old & new time windows.

    Brian
    Participant
    Post count: 21

    i think I can simplify the LassoLayer.selectObjects() code, since I already know what is selected and know what layer I need to work with.
    But, it creates new timelineobjectpath, which is something I am not doing.
    Also, wondering if I need my listener to add a key listener to make multiselect possible. I wanted to think the event and model have everything I needed to know, but I’m still missing something.

    Brian
    Participant
    Post count: 21

    I’ll also post this, which might help. to handle the TIMELINE_OBJECTS_REMOVED condition, I have code like follows. I guess this might do what it is supposed to be by unselecting the node. The problem is that it appears that the timeline object does not get unselected, so next call to the listener shows all the selections made over time. With that experience I wondered if the timeline object select should have been taken care of by the framework, if I needed to make another call (that does not just call back to the listener, causing an infinte loop), or what.

    } else if (ID.TIMELINE_OBJECTS_REMOVED == event.getId()) {

    for (final TimelineObjectPath path : paths) {
    final TreePath tp = path.getTreePath();
    chart.getTreeTable().removeSelectionPath(tp);
    // it is not safe to remove the TLO selection, b/c that just calls back to here and blows the stack
    LOG.debug(“removing row selection by TLO selection for path: {}”, path.toString());
    //LOG.debug(“setting row selection by TLO selection for treepath: {}”, tp);

    }

    Brian
    Participant
    Post count: 21

    Given what I said in the previous post about only getting one path at a time from
    event.getTimelineObjectPaths()

    I have found that I get all the selections if I call

    final ITimelineObjectSelectionModel selectionModel = chart.getLayerContainer().getSelectionModel(chart.getCustomTimeLineLayer());
    final Iterator treePaths = selectionModel.getSelectionPaths();

    Presumably I could iterate over this list and select all the corresponding nodes. But, I have not found a way to make this work. I;ve tried clearing first, then setting the selections to this list, as one example.

    Brian
    Participant
    Post count: 21

    That code works in some sense. It is OK when the user makes a single selection, but does not support multiselect.
    When I look at:
    final List paths = event.getTimelineObjectPaths();
    LOG.debug(“caught TLO selection event: {} has {} paths”, event, paths.size());
    I only ever see on path coming in. This could work out fine if I call
    chart.getTreeTable().addSelectionPath(tp);
    Rather than
    chart.getTreeTable().setSelectionPath(tp);

    Of course, making that change is not a big deal. The corresponding removal logic would need to be in place for the remove event. I;ve been through various forms of that logic too. I dont recall a situation where the simple code I posted above combined with a similar version for TIMELINE_OBJECTS_REMOVED has produced a functional model, certainly not for multiselect.

    Brian
    Participant
    Post count: 21

    I hate to have posted the above code, because it is a mess. However, in more reasonable times I have tried code that looked much like the below.
    public void valueChanged(final TimelineObjectSelectionEvent event) {
    final List paths = event.getTimelineObjectPaths();
    LOG.debug(“caught TLO selection event: {} has {} paths”, event, paths.size());
    //chart.getLayerContainer().getTimelineObjectLayer(chart.getCustomTimeLineLayer())

    final Object sourceObj = event.getSource();
    LOG.debug(“timeline object select source({}): {}”, sourceObj.getClass(), sourceObj);
    final DefaultTimelineObjectSelectionModel realSource = (DefaultTimelineObjectSelectionModel) sourceObj;

    // handle user dding a selection
    if (ID.TIMELINE_OBJECTS_ADDED == event.getId()) {

    for (final TimelineObjectPath path : paths) {
    final TreePath tp = path.getTreePath();
    chart.getTreeTable().setSelectionPath(tp);
    }
    Wanted to share what I had in the hopes that it gave an idea how I was thinking about the problem, so you could me moving in the right direction.

    Brian
    Participant
    Post count: 21

    Maybe I am not into the details enough to understand the implication of your question.  I guess I was thinking the new node would be passed into the function.  If that was a folder, then I can add the dragged leaf to it anywhere.  If the newNode is also a leaf, the dragged node can go before or after it, I don’t think it matters too much.

    Brian
    Participant
    Post count: 21

    No, we would like to the user to be able to move the TLO vertically, but if the drop is acceptable, then we want to move the entire node to that location. This is just the opposite of what happens when they move the node and the TLO follows.

    Brian
    Participant
    Post count: 21

    We have two sorts of dragging.  First, we drag tree nodes around, much like the file folder you mention.  We have leaf nodes that we place in certain folders and the user can move them to other folders.  in that case, the user is grabbing the visual representation of the node and moving it around, so the framework handles the task of keeping the timeline objects with the node they belong to.

    We are also OK for cases where the user moves the timeline horizontally, since it stays associated with the same tree table node.  But, in the case where the user grabs a timeline object and moves it vertically. the timeline object becomes associated with a different node.  That default framework behavior is not what we want in this case.  I’ve got some of the drag and drop code in place and expect that I need to handle the move to another node in that code.  I’m expecting that I need to do something like figure out the node associated with the timelineobject, determine the start position and the end position, then reorder the tree model to reflect the movement of the entire node (not just the movement of the timelineobject).

    I’m just not seeing how I can get to the ganttchart or model and don’t see how to move the node around.  Just occurred to me that I should gain some insight from DefaultNodeDragAndDropCommand and DefaultNodeDragAndDropPolicy. But, I’m sure your advice would still be helpful.  This is my first time working with Swing drag & drop.

    Brian
    Participant
    Post count: 21

    oops, a small cut/paste error in the above
    private static final TreeTableColumn col2 = new TreeTableColumn<>(MESSAGES”boo hoo”, Double.class, 2);
    should be
    private static final TreeTableColumn
    col2 = new TreeTableColumn<>(”boo hoo”, Double.class, 2);

Viewing 15 posts - 1 through 15 (of 15 total)