
it.tidalwave.netbeans.visual.impl.SelectionHandler Maven / Gradle / Ivy
The newest version!
/***********************************************************************************************************************
*
* OpenBlueSky - NetBeans Platform Enhancements
* Copyright (C) 2006-2012 by Tidalwave s.a.s. (http://www.tidalwave.it)
*
***********************************************************************************************************************
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*
***********************************************************************************************************************
*
* WWW: http://openbluesky.java.net
* SCM: https://bitbucket.org/tidalwave/openbluesky-src
*
**********************************************************************************************************************/
package it.tidalwave.netbeans.visual.impl;
import javax.annotation.Nonnull;
import java.beans.PropertyVetoException;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import org.openide.nodes.Node;
import org.openide.explorer.ExplorerManager;
import org.netbeans.api.visual.model.ObjectSceneEvent;
import org.netbeans.api.visual.model.ObjectSceneListener;
import org.netbeans.api.visual.model.ObjectState;
import it.tidalwave.util.logging.Logger;
/***********************************************************************************************************************
*
* @author Fabrizio Giudici
* @version $Id$
*
**********************************************************************************************************************/
public class SelectionHandler implements ObjectSceneListener
{
private static final String CLASS = SelectionHandler.class.getName();
private static final Logger logger = Logger.getLogger(CLASS);
@Nonnull
private final ExplorerManager explorerManager;
public SelectionHandler (final @Nonnull ExplorerManager explorerManager)
{
this.explorerManager = explorerManager;
}
// private final WidgetAction moveAction = ActionFactory.createMoveAction();
@Override
public void objectAdded (final @Nonnull ObjectSceneEvent event, final @Nonnull Object object)
{
}
@Override
public void objectRemoved (final @Nonnull ObjectSceneEvent event, final @Nonnull Object object)
{
}
@Override
public void objectStateChanged (final @Nonnull ObjectSceneEvent event,
final @Nonnull Object object,
final @Nonnull ObjectState previousState,
final @Nonnull ObjectState newState)
{
logger.info("objectStateChanged(%s, %s, %s, %s)", event, object, previousState, newState);
// final Widget widget = event.getObjectScene().findWidget(object);
// if (newState.isSelected()) moveAction is now in SceneFacade to listen to motion
// {
// widget.getActions().addAction(moveAction);
// }
// else
// {
// widget.getActions().removeAction(moveAction);
// }
}
@Override
public void selectionChanged (final @Nonnull ObjectSceneEvent event,
final @Nonnull Set
© 2015 - 2025 Weber Informatics LLC | Privacy Policy