Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 82283 Details for
Bug 207225
[context] problem with propagate interest when decayed parent has interest propagated from a child selection
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
patch addressing problem
clipboard.txt (text/plain), 5.80 KB, created by
Mik Kersten
on 2007-11-06 19:35:57 EST
(
hide
)
Description:
patch addressing problem
Filename:
MIME Type:
Creator:
Mik Kersten
Created:
2007-11-06 19:35:57 EST
Size:
5.80 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.mylyn.context.core >Index: src/org/eclipse/mylyn/internal/context/core/InteractionContextManager.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.context.core/src/org/eclipse/mylyn/internal/context/core/InteractionContextManager.java,v >retrieving revision 1.28 >diff -u -r1.28 InteractionContextManager.java >--- src/org/eclipse/mylyn/internal/context/core/InteractionContextManager.java 1 Nov 2007 00:17:42 -0000 1.28 >+++ src/org/eclipse/mylyn/internal/context/core/InteractionContextManager.java 7 Nov 2007 00:34:45 -0000 >@@ -415,6 +415,11 @@ > } > } > >+ /** >+ * Policy is that a parent should not have an interest lower than that of one of its children. This meets our goal >+ * of having them decay no faster than the children while having their interest be proportional to the interest of >+ * their children. >+ */ > private void propegateInterestToParents(IInteractionContext interactionContext, InteractionEvent.Kind kind, > IInteractionElement node, float previousInterest, float decayOffset, int level, > List<IInteractionElement> interestDelta) { >@@ -425,9 +430,10 @@ > } > > checkForLandmarkDeltaAndNotify(previousInterest, node); >- > level++; // original is 1st level >- float propagatedIncrement = node.getInterest().getValue() - previousInterest + decayOffset; >+ >+ // NOTE: original code summed parent interest >+// float propagatedIncrement = node.getInterest().getValue() - previousInterest + decayOffset; > > AbstractContextStructureBridge bridge = ContextCorePlugin.getDefault() > .getStructureBridge(node.getContentType()); >@@ -449,40 +455,40 @@ > } > > if (parentHandle != null) { >- InteractionEvent propagationEvent = new InteractionEvent(InteractionEvent.Kind.PROPAGATION, >- bridge.getContentType(node.getHandleIdentifier()), parentHandle, SOURCE_ID_MODEL_PROPAGATION, >- CONTAINMENT_PROPAGATION_ID, propagatedIncrement); >- IInteractionElement previous = interactionContext.get(propagationEvent.getStructureHandle()); >- if (previous != null && previous.getInterest() != null) { >- previousInterest = previous.getInterest().getValue(); >- } >- IInteractionElement parentNode = addInteractionEvent(interactionContext, propagationEvent); >- if (kind.isUserEvent() >- && parentNode.getInterest().getEncodedValue() < commonContextScaling.getInteresting()) { >- float parentOffset = ((-1) * parentNode.getInterest().getEncodedValue()) + 1; >+ String parentContentType = bridge.getContentType(parentHandle); >+ >+ IInteractionElement parentElement = interactionContext.get(parentHandle); >+ float parentPreviousInterest = 0; >+ if (parentElement != null && parentElement.getInterest() != null) { >+ parentPreviousInterest = parentElement.getInterest().getValue(); >+ } >+ >+ float increment = interactionContext.getScaling().getInteresting(); >+ if (parentPreviousInterest < node.getInterest().getValue()) { >+ increment = node.getInterest().getValue() - parentPreviousInterest; >+ InteractionEvent propagationEvent = new InteractionEvent(InteractionEvent.Kind.PROPAGATION, >+ parentContentType, parentHandle, SOURCE_ID_MODEL_PROPAGATION, CONTAINMENT_PROPAGATION_ID, increment); >+ parentElement = addInteractionEvent(interactionContext, propagationEvent); >+ } >+ >+ // NOTE: this might be redundant >+ if (parentElement != null && kind.isUserEvent() && parentElement.getInterest().getValue() < commonContextScaling.getInteresting()) { >+ float parentOffset = commonContextScaling.getInteresting() - parentElement.getInterest().getValue() + increment; > addInteractionEvent(interactionContext, new InteractionEvent(InteractionEvent.Kind.MANIPULATION, >- parentNode.getContentType(), parentNode.getHandleIdentifier(), SOURCE_ID_DECAY_CORRECTION, >- parentOffset)); >+ parentElement.getContentType(), parentElement.getHandleIdentifier(), >+ SOURCE_ID_DECAY_CORRECTION, parentOffset)); > } >- if (previous != null >- && isInterestDelta(previousInterest, previous.getInterest().isPredicted(), previous.getInterest() >- .isPropagated(), parentNode)) { >- interestDelta.add(0, parentNode); >- } >- propegateInterestToParents(interactionContext, kind, parentNode, previousInterest, decayOffset, level, >- interestDelta);// adapter.getResourceExtension(), >+ >+ if (parentElement != null >+ && isInterestDelta(parentPreviousInterest, parentElement.getInterest().isPredicted(), >+ parentElement.getInterest().isPropagated(), parentElement)) { >+ interestDelta.add(0, parentElement); >+ } >+ propegateInterestToParents(interactionContext, kind, parentElement, parentPreviousInterest, decayOffset, level, >+ interestDelta); > } > } > >-// public List<IInteractionElement> >-// findCompositesForNodes(List<InteractionContextElement> nodes) { >-// List<IInteractionElement> composites = new ArrayList<IInteractionElement>(); >-// for (InteractionContextElement node : nodes) { >-// composites.add(aaactiveContext.get(node.getHandleIdentifier())); >-// } >-// return composites; >-// } >- > public void addListener(IInteractionContextListener listener) { > if (listener != null) { > if (suppressListenerNotification && !waitingListeners.contains(listener)) { >@@ -527,7 +533,7 @@ > ACTIVITY_STRUCTUREKIND_ACTIVATION, context.getHandleIdentifier(), ACTIVITY_ORIGINID_WORKBENCH, > null, ACTIVITY_DELTA_ACTIVATED, 1f)); > } >- >+ > for (IInteractionContextListener listener : listeners) { > try { > listener.contextActivated(context); >@@ -1000,7 +1006,7 @@ > } else { > // make uninteresting > if (originalValue >= 0) { >- changeValue = (-1 * originalValue) - 1; >+ changeValue = ((-1) * originalValue) - 1; > } > > // reduce interest of children
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 207225
: 82283 |
82284
|
82285