Examples of LinkedHashMap


Examples of java.util.LinkedHashMap

        }
    }


    public LinkedHashMap getCollectiveActions(DiagramSelection sel, double x, double y, Object o, int context) {
        LinkedHashMap res = super.getCollectiveActions(sel, x, y, o, context);
       
        // Bar shapes are not able to be rotated
        res.remove(Abstract1DShape.resources.getString("rotation") + ";" + Abstract1DShape.resources.getString("leftRotation"));
        res.remove(Abstract1DShape.resources.getString("rotation") + ";" + Abstract1DShape.resources.getString("rightRotation"));

        return res;
    }
View Full Code Here

Examples of java.util.LinkedHashMap

     * (non-Javadoc)
     *
     * @see jsynoptic.base.SelectionContextualActionProvider#getCollectiveActions()
     */
    public LinkedHashMap getCollectiveActions(DiagramSelection sel, double x, double y, Object o, int context) {
        LinkedHashMap res = super.getCollectiveActions(sel, x, y, o, context);
        res.put(resources.getString("AdjustSize"), null);
 
        // Body action
        for (int i = 0; i < FontChooserPanel.SIZES.length; i++) {
            res.put(resources.getString("Body") + ";" + FontChooserPanel.SIZES[i], null);
        }
        // Font action
        for (int i = 0; i < AbstractShape.FONT_NAMES.length; i++) {
            res.put(resources.getString("Font") + ";" + AbstractShape.FONT_NAMES[i], null);
        }
       
        if (context == EDITOR_CONTEXT) {
            if ((o instanceof DataSource) && (canAddDataSource(((DataSource) o)))) {
                res.put(resources.getString("SetSource"), null);
            }
        }
        return res;
    }
View Full Code Here

Examples of java.util.LinkedHashMap

    /* (non-Javadoc)
     * @see jsynoptic.builtin.Abstract1DShape#getCollectiveActions(simtools.diagram.DiagramSelection, double, double, java.lang.Object, int)
     */
    public LinkedHashMap getCollectiveActions(DiagramSelection sel, double x, double y, Object o, int context) {
        LinkedHashMap res = super.getCollectiveActions(sel, x, y, o, context);
       
        res.put(resources.getString("RightAnglePath"), resources.getIcon("RightAnglePathIcon"));
        res.put(resources.getString("StraightPath"), resources.getIcon("StraightPathIcon"));
      
        return res;
    }
View Full Code Here

Examples of java.util.LinkedHashMap

        return (String[]) v.toArray(new String[v.size()]);
    }


    public LinkedHashMap getCollectiveActions(DiagramSelection sel, double x, double y, Object o, int context) {
        LinkedHashMap res = new LinkedHashMap();
       
        res.put(resources.getString("properties"), null);
       
        res.put(resources.getString("rotation") + ";" + resources.getString("leftRotation"), resources
                .getIcon("leftRotationImage"));
        res.put(resources.getString("rotation") + ";" + resources.getString("rightRotation"), resources
                .getIcon("rightRotationImage"));
        return res;
    }
View Full Code Here

Examples of java.util.LinkedHashMap

     */
    public static List getAttributes(
        final Classifier classifier,
        final boolean follow)
    {
        final Map attributeMap = new LinkedHashMap(); // preserve ordering
        final List members = new ArrayList(classifier.getOwnedMembers());

        if (follow)
        {
            members.addAll(classifier.getInheritedMembers());
        }

        for (final Iterator memberIterator = members.iterator(); memberIterator.hasNext();)
        {
            final Object nextCandidate = memberIterator.next();
            if (nextCandidate instanceof Property)
            {
                final Property property = (Property)nextCandidate;

                if (property.getAssociation() == null)
                {
                    if (logger.isDebugEnabled())
                    {
                        logger.debug("Attribute found for " + classifier.getName() + ": " + property.getName());
                        if (attributeMap.containsKey(property.getName()))
                        {
                            logger.warn(
                                "An attribute with this name has already been registered, overriding: " +
                                property.getName());
                        }
                    }

                    // property represents an association end
                    attributeMap.put(
                        property.getName(),
                        property);
                }
            }
        }

        final List attributeList = new ArrayList(attributeMap.values());
        CollectionUtils.transform(
            attributeList,
            ELEMENT_TRANSFORMER);
        return attributeList;
    }
View Full Code Here

Examples of java.util.LinkedHashMap

   */
  public ShoppingBasket() {
    sGuCustomer = null;
    oLines = new ArrayList();
    oProps = new HashMap();
    oAddressesByName = new LinkedHashMap(13);
    oAddressesByIndex = new TreeMap();
    oLastLine = null;
    iLastLine = -1;
  }
View Full Code Here

Examples of java.util.LinkedHashMap

        List tableNonColumnActionParameters = null;

        final StrutsParameter table = getTableLinkParameter();
        if (table != null)
        {
            final Map tableNonColumnActionParametersMap = new LinkedHashMap(4);
            final Collection columnNames = table.getTableColumnNames();
            final List formActions = table.getTableFormActions();
            for (int i = 0; i < formActions.size(); i++)
            {
                final StrutsAction action = (StrutsAction) formActions.get(i);
                for (int j = 0; j < action.getActionParameters().size(); j++)
                {
                    final StrutsParameter parameter = (StrutsParameter) action.getActionParameters().get(j);
                    if (!columnNames.contains(parameter.getName()))
                    {
                        tableNonColumnActionParametersMap.put(parameter.getName(), parameter);
                    }
                }
            }

            tableNonColumnActionParameters = new ArrayList(tableNonColumnActionParametersMap.values());
        }

        return tableNonColumnActionParameters;
    }
View Full Code Here

Examples of java.util.LinkedHashMap

    /* (non-Javadoc)
     * @see jsynoptic.base.SelectionContextualActionProvider#getCollectiveActions()
     */
    public LinkedHashMap getCollectiveActions(DiagramSelection sel, double x, double y, Object o, int context) {
        LinkedHashMap res=new LinkedHashMap();

        if (((primaryCurves!=null) && (primaryCurves.size()!=0))
                || ((secondaryCurves!=null) && (secondaryCurves.size()!=0))) {       // do both primary and secondary
            res.put(resources.getStringValue("autoscale"), null);
            res.put(resources.getStringValue("autoscaleOnY"), null);

            if (sel.getShapeCount() > 1) {
                res.put(resources.getStringValue("adjustOnX") + ";" +  resources.getStringValue("union"), null);
                res.put(resources.getStringValue("adjustOnX") + ";" +  resources.getStringValue("intersection"), null);
                res.put(resources.getStringValue("adjustOnX") + ";" +  resources.getStringValue("firstPlotSelected"), null);
            }
        }

        if (o instanceof DataSource) {
            res.put(resources.getStringValue("setX"), null);
        }

        return res;
    }
View Full Code Here

Examples of java.util.LinkedHashMap

        this.printLine();
        this.printText(MARGIN + bannerStart + "   A n d r o M D A   P o w e r e d   A p p l i c a t i o n");
        this.printLine();
        rootDirectory.mkdirs();

        final Map locations = new LinkedHashMap();

        // - first write any mapped resources
        for (final Iterator iterator = this.resourceLocations.iterator(); iterator.hasNext();)
        {
            final String location = (String)iterator.next();
            final URL[] resourceDirectories = ResourceFinder.findResources(location);
            if (resourceDirectories != null)
            {
                final int numberOfResourceDirectories = resourceDirectories.length;
                for (int ctr = 0; ctr < numberOfResourceDirectories; ctr++)
                {
                    final URL resourceDirectory = resourceDirectories[ctr];
                    final List contents = ResourceUtils.getDirectoryContents(
                            resourceDirectory,
                            false,
                            null);
                    final Set newContents = new LinkedHashSet();
                    locations.put(
                        location,
                        newContents);
                    for (final ListIterator contentsIterator = contents.listIterator(); contentsIterator.hasNext();)
                    {
                        final String path = (String)contentsIterator.next();
                        if (!path.endsWith(FORWARD_SLASH))
                        {
                            boolean hasNewPath = false;
                            for (final Iterator mappingIterator = this.mappings.iterator(); mappingIterator.hasNext();)
                            {
                                final Mapping mapping = (Mapping)mappingIterator.next();
                                String newPath = mapping.getMatch(path);
                                if (newPath != null && newPath.length() > 0)
                                {
                                    final URL absolutePath = ResourceUtils.getResource(path);
                                    if (absolutePath != null)
                                    {
                                        newPath =
                                            this.getTemplateEngine().getEvaluatedExpression(
                                                newPath,
                                                this.templateContext);
                                        ResourceWriter.instance().writeUrlToFile(
                                            absolutePath,
                                            ResourceUtils.normalizePath(TEMPORARY_MERGE_LOCATION + '/' + newPath));
                                        newContents.add(newPath);
                                        hasNewPath = true;
                                    }
                                }
                            }
                            if (!hasNewPath)
                            {
                                newContents.add(path);
                            }
                        }
                    }
                }
            }
        }

        // - second process and write any output from the defined resource locations.
        for (final Iterator iterator = locations.keySet().iterator(); iterator.hasNext();)
        {
            final String location = (String)iterator.next();
            final Collection contents = (Collection)locations.get(location);
            if (contents != null)
            {
                for (final Iterator contentsIterator = contents.iterator(); contentsIterator.hasNext();)
                {
                    final String path = (String)contentsIterator.next();
View Full Code Here

Examples of java.util.LinkedHashMap

                    path.length());
        }

        Boolean writable = null;

        final Map evaluatedPaths = new LinkedHashMap();
        for (final Iterator iterator = this.outputConditions.iterator(); iterator.hasNext();)
        {
            final Conditions conditions = (Conditions)iterator.next();
            final Map outputPaths = conditions.getOutputPaths();
            final String conditionsType = conditions.getType();
            int ctr = 0;
            for (final Iterator pathIterator = outputPaths.keySet().iterator(); pathIterator.hasNext(); ctr++)
            {
                final String outputPath = (String)pathIterator.next();

                // - only evaluate if we haven't yet evaluated
                writable = (Boolean)evaluatedPaths.get(path);
                if (writable == null)
                {
                    if (path.startsWith(outputPath))
                    {
                        final String[] patterns = (String[])outputPaths.get(outputPath);
                        if (ResourceUtils.matchesAtLeastOnePattern(
                                path,
                                patterns))
                        {
                            // - assume writable is false, since the path matches at least one conditions path.
                            for (final Iterator conditionIterator = conditions.getConditions().iterator();
                                conditionIterator.hasNext();)
                            {
                                final Condition condition = (Condition)conditionIterator.next();
                                final String id = condition.getId();
                                if (id != null && id.trim().length() > 0)
                                {
                                    final boolean result = condition.evaluate(this.templateContext.get(id));
                                    writable = Boolean.valueOf(result);
                                    if (Conditions.TYPE_AND.equals(conditionsType) && !result)
                                    {
                                        // - if we 'and' the conditions, we break at the first false
                                        break;
                                    }
                                    else if (Conditions.TYPE_OR.equals(conditionsType) && result)
                                    {
                                        // - otherwise we break at the first true condition
                                        break;
                                    }
                                }
                            }
                        }
                    }
                    if (writable != null)
                    {
                        evaluatedPaths.put(
                            path,
                            writable);
                    }
                }
            }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.