Examples of Space


Examples of com.geophile.z.Space

            boolean equal = expected.rowType().nFields() == actual.rowType().nFields();
            if (!equal)
                return false;
            nFields = actual.rowType().nFields();
        }
        Space space = space(expected.rowType());
        if (space != null) {
            nFields = nFields - space.dimensions() + 1;
        }
        for (int actualPosition = 0, expectedPosition = 0;
             actualPosition < nFields && expectedPosition < nFields;
             actualPosition++, expectedPosition++) {
            if(skipInternalColumns) {
View Full Code Here

Examples of com.mlarktar.spacewar.Space

  private int wideAccumulator;
  private SpaceWar app;

  public WellcomeSpaceWar(SpaceWar app) {
    this.app = app;
    space = new Space();
    panel = space;
  }
View Full Code Here

Examples of engine.utility.Space

    public LevelScene(final Level level) {
        this.level = level;
        chunks = this.level.getChunks();
        blocks = this.level.getBlocks();
        actors = this.level.getActors();
        space = new Space(chunks[0].length * Chunk.WIDTH, chunks.length * Chunk.HEIGHT);
    }
View Full Code Here

Examples of info.jtrac.domain.Space

   
    public static ItemSearch getItemSearch(User user, PageParameters params, Jtrac jtrac) throws JtracSecurityException {
        long spaceId = params.getLong("s", -1);       
        ItemSearch itemSearch = null;
        if(spaceId > 0) {           
            Space space = jtrac.loadSpace(spaceId);
            if(!user.isAllocatedToSpace(space.getId())) {
                throw new JtracSecurityException("User not allocated to space: " + spaceId + " in URL: " + params);
            }
            itemSearch = new ItemSearch(space);           
        } else {
            itemSearch = new ItemSearch(user);
View Full Code Here

Examples of info.jtrac.domain.Space

            add(new ListView("spaces", allowedSpaces) {
                protected void populateItem(ListItem listItem) {
                    long spaceId = (Long) listItem.getModelObject();   
                    List<UserSpaceRole> usrs = spaceRolesMap.get(spaceId);
                    // space can be null for "all spaces" role (prefixCode used in map = "")
                    final Space space = usrs.get(0).getSpace();                    
                    if(space != null && space.getId() == selectedSpaceId) {
                        listItem.add(new SimpleAttributeModifier("class", "selected"));
                    } else if(listItem.getIndex() % 2 == 1) {
                        listItem.add(sam);
                    }                                                                                                        
                    if(space == null) {                       
                        listItem.add(new Label("name", localize("user_allocate_space.allSpaces")));
                        listItem.add(new WebMarkupContainer("prefixCode").setVisible(false));                       
                    } else {
                        listItem.add(new Label("name", space.getName()));
                        listItem.add(new Link("prefixCode") {
                            public void onClick() {
                                if(previous instanceof SpaceAllocatePage) { // prevent recursive stack buildup
                                    previous = null;
                                }                               
                                setResponsePage(new SpaceAllocatePage(space.getId(), UserAllocatePage.this, userId));
                            }
                        }.add(new Label("prefixCode", space.getPrefixCode())));
                    }
                    listItem.add(new RoleDeAllocatePanel("roleDeAllocatePanel", usrs));                   
                }
            });                      
           
            List<Space> spaces = getJtrac().findSpacesNotFullyAllocatedToUser(user.getId());
           
            if(!isPrincipalSuperUser) {
                // not super user, show only spaces which can admin
                Set<Space> set = new HashSet(spaces);               
                List<Space> allowed = new ArrayList<Space>();
                // also within these spaces may be fully allocated, so trim
                for(Space s : principal.getSpacesWhereRoleIsAdmin()) {
                    if(set.contains(s)) {
                        allowed.add(s);
                    }
                }
                spaces = allowed;
            }
           
            DropDownChoice spaceChoice = new DropDownChoice("space", spaces, new IChoiceRenderer() {
                public Object getDisplayValue(Object o) {
                    Space space = (Space) o;
                    return space.getName() + " [" + space.getPrefixCode() + "]";
                }
                public String getIdValue(Object o, int i) {
                    return ((Space) o).getId() + "";
                }
            });           
            spaceChoice.setNullValid(true);
           
            add(spaceChoice);
           
            spaceChoice.add(new AjaxFormComponentUpdatingBehavior("onChange") {
                protected void onUpdate(AjaxRequestTarget target) {
                    Space s = (Space) getFormComponent().getConvertedInput();
                    if (s == null) {
                        roleAllocatePanel.setChoices(new ArrayList<String>());
                        allocateButton.setEnabled(false);
                    } else {
                        Space temp = getJtrac().loadSpace(s.getId());
                        // populate choice, enable button etc
                        initRoleChoice(temp);
                    }
                    target.addComponent(roleAllocatePanel);
                    target.addComponent(allocateButton);
View Full Code Here

Examples of info.jtrac.domain.Space

       
        final SimpleAttributeModifier sam = new SimpleAttributeModifier("class", "alt");
       
        ListView listView = new ListView("spaces", spaceListModel) {
            protected void populateItem(ListItem listItem) {               
                final Space space = (Space) listItem.getModelObject();               
                if (selectedSpaceId == space.getId()) {
                    listItem.add(new SimpleAttributeModifier("class", "selected"));
                } else if(listItem.getIndex() % 2 == 1) {
                    listItem.add(sam);
                }                                
                listItem.add(new Label("prefixCode", new PropertyModel(space, "prefixCode")));
                listItem.add(new Label("name", new PropertyModel(space, "name")));
                Link edit = new Link("edit") {
                    public void onClick() {
                        Space temp = getJtrac().loadSpace(space.getId());
                        temp.getMetadata().getXmlString()// hack to override lazy loading
                        SpaceFormPage page = new SpaceFormPage(temp);
                        page.setPrevious(SpaceListPage.this);
                        setResponsePage(page);                       
                    }                   
                };
View Full Code Here

Examples of info.jtrac.domain.Space

                /*
                 * ===================================================
                 * Assigned to
                 * ===================================================
                 */
                Space space = item.getSpace();
                List<UserSpaceRole> userSpaceRoles = getJtrac().findUserRolesForSpace(space.getId());
                List<User> assignable = UserUtils.filterUsersAbleToTransitionFrom(userSpaceRoles, space, State.OPEN);
                DropDownChoice choice = new DropDownChoice("assignedTo", assignable, new IChoiceRenderer() {
                    public Object getDisplayValue(Object o) {
                        return ((User) o).getName();
                    }
View Full Code Here

Examples of info.jtrac.domain.Space

    public DashboardRowExpandedPanel(String id, final UserSpaceRole usr, final Counts counts) {       
       
        super(id);
        setOutputMarkupId(true);
       
        final Space space = usr.getSpace();
        final User user = usr.getUser();
       
        final Map<Integer, String> states = new TreeMap(space.getMetadata().getStatesMap());   
        states.remove(State.NEW);
        int rowspan = states.size() + 1; // add one totals row also
        final SimpleAttributeModifier sam = new SimpleAttributeModifier("rowspan", rowspan + "");
        List<Integer> stateKeys = new ArrayList<Integer>(states.keySet());                                               
       
        add(new ListView("rows", stateKeys) {
           
            protected void populateItem(ListItem listItem) {                               
               
                if (listItem.getIndex() == 0) { // rowspan output only for first row           
                   
                    WebMarkupContainer spaceCell = new WebMarkupContainer("space");    
                    spaceCell.add(sam);
                    listItem.add(spaceCell);
                                     
                    spaceCell.add(new Label("name", space.getName()));
                    spaceCell.add(new Label("prefixCode", space.getPrefixCode()));
                   
                    WebMarkupContainer newColumn = new WebMarkupContainer("new");
                    newColumn.add(sam);  
                    listItem.add(newColumn);
                   
View Full Code Here

Examples of info.jtrac.domain.Space

            add(new TextArea("comment").setRequired(true).add(new ErrorHighlighter()));
            // custom fields ===================================================
            User user = getPrincipal();
            add(new CustomFieldsFormPanel("fields", model, item, user));
            // =================================================================
            final Space space = item.getSpace();
            final List<UserSpaceRole> userSpaceRoles = getJtrac().findUserRolesForSpace(space.getId());           
            // assigned to =====================================================
            final WebMarkupContainer border = new WebMarkupContainer("border");
            border.setOutputMarkupId(true);
            final WebMarkupContainer hide = new WebMarkupContainer("hide");
            border.add(hide);                      
            final List<User> emptyList = new ArrayList<User>(0)// will be populated over Ajax
            assignedToChoice = new DropDownChoice("assignedTo", emptyList, new IChoiceRenderer() {
                public Object getDisplayValue(Object o) {
                    return ((User) o).getName();
                }
                public String getIdValue(Object o, int i) {
                    return ((User) o).getId() + "";
                }
            });
            assignedToChoice.setOutputMarkupId(true);
            assignedToChoice.setVisible(false);
            assignedToChoice.setNullValid(true);           
            border.add(new ErrorHighlighter(assignedToChoice));
            border.add(assignedToChoice);
            add(border);
            // status ==========================================================
            final Map<Integer, String> statesMap = item.getPermittedTransitions(user);
            List<Integer> states = new ArrayList(statesMap.keySet());
            statusChoice = new IndicatingDropDownChoice("status", states, new IChoiceRenderer() {
                public Object getDisplayValue(Object o) {
                    return statesMap.get(o);
                }
                public String getIdValue(Object o, int i) {
                    return o.toString();
                }
            });
            statusChoice.setNullValid(true);
            statusChoice.add(new ErrorHighlighter());
            statusChoice.add(new AjaxFormComponentUpdatingBehavior("onChange") {
                protected void onUpdate(AjaxRequestTarget target) {
                    Integer selectedStatus = (Integer) getFormComponent().getConvertedInput();
                    if (selectedStatus == null) {                       
                        assignedToChoice.setVisible(false);
                        hide.setVisible(true);
                    } else {
                        List<User> assignable = UserUtils.filterUsersAbleToTransitionFrom(userSpaceRoles, space, selectedStatus);
                        assignedToChoice.setChoices(assignable);
                        assignedToChoice.setVisible(true);
                        hide.setVisible(false);
                    }
                    target.addComponent(border);
                }
            });
            add(statusChoice);
            // notify list =====================================================
            List<ItemUser> choices = UserUtils.convertToItemUserList(userSpaceRoles);
            ListMultipleChoice itemUsers = new JtracCheckBoxMultipleChoice("itemUsers", choices, new IChoiceRenderer() {
                public Object getDisplayValue(Object o) {
                    return ((ItemUser) o).getUser().getName();
                }
                public String getIdValue(Object o, int i) {
                    return ((ItemUser) o).getUser().getId() + "";
                }
            }, true);
            add(itemUsers);
            // attachment ======================================================
            fileUploadField = new FileUploadField("file");
            add(fileUploadField);
            setMaxSize(Bytes.megabytes(getJtrac().getAttachmentMaxSizeInMb()));
            // send notifications===============================================
            add(new CheckBox("sendNotifications"));
            // validation that assignedTo is not null if status is not null and not CLOSED
            // have to use FormValidator because this is conditional validation across two FormComponents
            add(new AbstractFormValidator() {
                public FormComponent[] getDependentFormComponents() {
                    // actually we depend on assignedToChoice also, but wicket logs a warning when the
                    // component is not visible but we are doing ajax.  anyway we use assignedToChoice.getInput()
                    // not assignedToChoice.convertedInput() so no danger there
                    return new FormComponent[] {statusChoice};
                }
                public void validate(Form unused) {
                    if(assignedToChoice.getInput() == null || assignedToChoice.getInput().trim().length() == 0) {
                        Integer i = (Integer) statusChoice.getConvertedInput();
                        if (i != null && i != State.CLOSED) {
                            // user may have customized the name of the CLOSED State e.g. for i18n
                            // so when reporting the error, use the display name
                            String closedDisplayName = space.getMetadata().getStatusValue(State.CLOSED);
                            assignedToChoice.error(localize("item_view_form.assignedTo.error", closedDisplayName));
                        }
                    }
                }
            });
View Full Code Here

Examples of info.jtrac.domain.Space

   
    public HeaderPanel() {
        super("header");
       
        final User user = getPrincipal();
        final Space space = getCurrentSpace();
        final List<Space> spaces = new ArrayList(user.getSpaces());
       
        add(new Link("dashboard") {
            public void onClick() {
                setCurrentSpace(null);
                setResponsePage(DashboardPage.class);
            }           
        });
       
        if (space == null) {
            add(new WebMarkupContainer("spaceName").setVisible(false));
            add(new WebMarkupContainer("new").setVisible(false));
            add(new Link("search") {
                public void onClick() {                   
                    // if only one space don't use generic search screen
                    if(spaces.size() == 1) {
                        Space current = spaces.get(0);
                        setCurrentSpace(current);                       
                    } else {
                        setCurrentSpace(null); // may have come here with back button!                       
                    }
                    setResponsePage(ItemSearchFormPage.class);
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.