예제 #1
0
    private List <FilterItem> CreateFilterItems()
    {
        try
        {
            GroupInfo   info   = GroupContext.GetGroupContext().CurrentGroupInfo.CurrentGroup.GroupInformation;
            GroupLayout layout = info.GetGroupLayout();

            List <FilterItem> items = new List <FilterItem>();
            foreach (GroupLayoutItem layoutItem in layout.Items)
            {
                if (!layoutItem.IsFilterable)
                {
                    continue;
                }

                FilterItem item = new FilterItem();
                item.Name   = layoutItem.Caption;
                item.Alias  = layoutItem.Alias;
                item.Hidden = _hiddenFilters.Contains(layoutItem.Alias);
                items.Add(item);
            }

            return(items);
        }
        catch
        {
            return(new List <FilterItem>());
        }
    }
예제 #2
0
        private async Task PrepareForFight(Tile enemyTile)
        {
            var moveDirection = Location.Tile.Neighbours.Single(t => t.Item1 == enemyTile).Item2;

            while (true)
            {
                var routeToSide = GroupLayout.GetToSide(this, Location.Tile, moveDirection);
                if (routeToSide != null)
                {
                    foreach (var space in routeToSide.Skip(1))
                    {
                        if (!await MoveToSpace(space))
                        {
                            goto whileLoop;
                        }
                        await Task.Delay(MoveDuration);
                    }

                    await Fight(enemyTile, moveDirection);

                    break;
                }

whileLoop:
                await Task.Delay(100);
            }
        }
예제 #3
0
        protected virtual async Task PrepareForFight(ITile enemyTile)
        {
            if (Location == null)
            {
                return;
            }

            var moveDirection = Location.Tile.Neighbors.SingleOrDefault(t => t.Item1 == enemyTile)?.Item2;

            if (moveDirection == null)
            {
                //creature fall to pit for example
                return;
            }

            var routeToSide = GroupLayout.GetToSide(Location, moveDirection.Value, false);

            if (routeToSide != null)
            {
                foreach (var space in routeToSide.Skip(1))
                {
                    if (!await MoveToSpace(space))
                    {
                        return;
                    }
                    await Task.Delay(MoveDuration);
                }
                if (Location == null)
                {
                    return;
                }
                new CreatureAttack(this).Apply(moveDirection.Value);
                await Task.Delay(attackDuration);
            }
        }
예제 #4
0
        private async Task <bool> MoveThroughSpaces(Tile targetTile, bool findEnemies)
        {
            var spaceRoute = GroupLayout.GetToNeighbour(this, Location.Tile, targetTile);

            if (spaceRoute == null)
            {
                return(false);
            }

            foreach (var space in spaceRoute.Skip(1))
            {
                if (findEnemies && FindEnemies())
                {
                    return(false);
                }

                var duration = Task.Delay(MoveDuration);
                if (!await MoveToSpace(space))
                {
                    return(false);
                }

                await duration;
            }
            return(true);
        }
예제 #5
0
        private void initComponents()
        {
            scrollPane        = new JScrollPane();
            chatMessagesLabel = new JLabel();
            chatMessage       = new JTextField();
            sendButton        = new JButton();
            adhocIDLabel      = new JLabel();
            groupNameLabel    = new JLabel();
            membersLabel      = new JLabel();
            membersList       = new JLabel();

            Title     = "Chat";
            Resizable = true;

            sendButton.Text           = "Send";
            sendButton.DefaultCapable = true;
            RootPane.DefaultButton    = sendButton;
            sendButton.addActionListener(new ActionListenerAnonymousInnerClass(this));

            // Start displaying the chat message from the bottom
            chatMessagesLabel.VerticalAlignment = SwingConstants.BOTTOM;
            chatMessagesLabel.PreferredSize     = new Dimension(500, 300);

            scrollPane.ViewportView = chatMessagesLabel;

            adhocIDLabel.Text   = AdhocID;
            groupNameLabel.Text = GroupName;
            membersLabel.Text   = "Members:";

            membersList.PreferredSize = new Dimension(100, chatMessagesLabel.PreferredSize.height);

            chatMessage.Editable = true;

            //
            // Layout:
            //
            // +-------------------------------------------+-----------------+
            // |                                           | adhocIDLabel    |
            // |                                           | groupNameLabel  |
            // | chatMessageLabel in scrollPane            | membersLabel    |
            // |                                           +-----------------+
            // |                                           | membersList     |
            // |                                           |                 |
            // |                                           |                 |
            // |                                           |                 |
            // |                                           |                 |
            // +-------------------------------------------+----+------------+
            // | chatMessage                                    | sendButton |
            // +------------------------------------------------+------------+
            //
            GroupLayout layout = new GroupLayout(ContentPane);

            ContentPane.Layout     = layout;
            layout.HorizontalGroup = layout.createParallelGroup().addGroup(layout.createSequentialGroup().addComponent(scrollPane).addGroup(layout.createParallelGroup().addGroup(layout.createParallelGroup().addComponent(adhocIDLabel)).addGroup(layout.createParallelGroup().addComponent(groupNameLabel)).addComponent(membersLabel).addComponent(membersList))).addGroup(layout.createSequentialGroup().addComponent(chatMessage).addComponent(sendButton));
            layout.VerticalGroup   = layout.createSequentialGroup().addGroup(layout.createParallelGroup().addComponent(scrollPane).addGroup(layout.createSequentialGroup().addGroup(layout.createParallelGroup().addComponent(adhocIDLabel)).addGroup(layout.createParallelGroup().addComponent(groupNameLabel)).addComponent(membersLabel).addComponent(membersList))).addGroup(layout.createParallelGroup().addComponent(chatMessage).addComponent(sendButton));
            pack();
        }
예제 #6
0
        public Footer(XElement element)
        {
            XNamespace ns           = element.GetDefaultNamespace();
            XElement   tableElement = element?.Element(ns + "GroupLayout");

            if (tableElement != null)
            {
                GroupLayout = (GroupLayout)Layout.Load(tableElement);
            }

            LineNumber   = ((IXmlLineInfo)element)?.LineNumber ?? 0;
            LinePosition = ((IXmlLineInfo)element)?.LinePosition ?? 0;
        }
예제 #7
0
        private void TryDie(object sender, int value)
        {
            if (Activated && value <= 0)
            {
                Activated = false;

                //if (animator.IsAnimating && animator.AnimatingTask != null)
                //    await animator.AnimatingTask;

                //location.Tile.LayoutManager.FreeSpace(this, location.Space);
                //location.Tile.OnObjectLeft(this);
                //location.Tile.Level.Updateables.Remove(this);

                foreach (var item in Possessions)
                {
                    item.Location = GroupLayout.GetSpaceElement(location.Space, location.Tile);
                }
                Location = null;
            }
        }
예제 #8
0
        private void Kill()
        {
            Activated = false;

            Died?.Invoke(this, this);
            location.Tile.LayoutManager.FreeSpace(this, location.Space);

            foreach (var storage in Body.Storages)
            {
                for (int i = 0; i < storage.Storage.Count; i++)
                {
                    var item = storage.TakeItemFrom(i);
                    if (item != null)
                    {
                        item.Location = GroupLayout.GetSpaceElement(Location.Space, location.Tile);
                    }
                }
            }
            bones.Location = GroupLayout.GetSpaceElement(Location.Space, location.Tile);
            location       = null;
        }
예제 #9
0
        private VfpuFrame()
        {
            DefaultCloseOperation = DISPOSE_ON_CLOSE;
            Title = java.util.ResourceBundle.getBundle("pspsharp/languages/pspsharp").getString("VfpuFrame.title");             // NOI18N

            for (int i = 0; i < 8; ++i)
            {
                for (int j = 0; j < 4; ++j)
                {
                    for (int k = 0; k < 4; ++k)
                    {
                        registers[i][j][k] = new JTextField();
                    }
                }
            }

            GroupLayout layout = new GroupLayout(ContentPane);

            ContentPane.Layout = layout;

            for (int i = 0; i < panels.Length; ++i)
            {
                JPanel panel = new JPanel();
                panels[i] = panel;

                GroupLayout l = new GroupLayout(panel);
                panel.Layout = l;
                panel.Border = BorderFactory.createCompoundBorder(BorderFactory.createTitledBorder("Block " + i), null);

                l.HorizontalGroup = l.createSequentialGroup().addGroup(l.createParallelGroup().addComponent(registers[i][0][0]).addComponent(registers[i][1][0]).addComponent(registers[i][2][0]).addComponent(registers[i][3][0])).addGroup(l.createParallelGroup().addComponent(registers[i][0][1]).addComponent(registers[i][1][1]).addComponent(registers[i][2][1]).addComponent(registers[i][3][1])).addGroup(l.createParallelGroup().addComponent(registers[i][0][2]).addComponent(registers[i][1][2]).addComponent(registers[i][2][2]).addComponent(registers[i][3][2])).addGroup(l.createParallelGroup().addComponent(registers[i][0][3]).addComponent(registers[i][1][3]).addComponent(registers[i][2][3]).addComponent(registers[i][3][3]));
                l.VerticalGroup   = l.createSequentialGroup().addGroup(l.createParallelGroup().addComponent(registers[i][0][0]).addComponent(registers[i][0][1]).addComponent(registers[i][0][2]).addComponent(registers[i][0][3])).addGroup(l.createParallelGroup().addComponent(registers[i][1][0]).addComponent(registers[i][1][1]).addComponent(registers[i][1][2]).addComponent(registers[i][1][3])).addGroup(l.createParallelGroup().addComponent(registers[i][2][0]).addComponent(registers[i][2][1]).addComponent(registers[i][2][2]).addComponent(registers[i][2][3])).addGroup(l.createParallelGroup().addComponent(registers[i][3][0]).addComponent(registers[i][3][1]).addComponent(registers[i][3][2]).addComponent(registers[i][3][3]));
            }

            layout.HorizontalGroup = layout.createParallelGroup().addGroup(layout.createSequentialGroup().addComponent(panels[0]).addComponent(panels[1])).addGroup(layout.createSequentialGroup().addComponent(panels[2]).addComponent(panels[3])).addGroup(layout.createSequentialGroup().addComponent(panels[4]).addComponent(panels[5])).addGroup(layout.createSequentialGroup().addComponent(panels[6]).addComponent(panels[7]));
            layout.VerticalGroup   = layout.createParallelGroup().addGroup(layout.createSequentialGroup().addComponent(panels[0]).addComponent(panels[2]).addComponent(panels[4]).addComponent(panels[6])).addGroup(layout.createSequentialGroup().addComponent(panels[1]).addComponent(panels[3]).addComponent(panels[5]).addComponent(panels[7]));

            MinimumSize = new Dimension(450, 450);
            WindowPropSaver.loadWindowProperties(this);
        }
예제 #10
0
        // <editor-fold defaultstate="collapsed" desc="Generated Code">
        private void initComponents()
        {
            canvas = new BufferedImage(320, 320, BufferedImage.TYPE_BYTE_GRAY);

            buttonGroup1 = new ButtonGroup();
            buttonGroup2 = new ButtonGroup();
            jPanel4      = new JPanel();
            jSlider2     = new JSlider();
            jLabel1      = new JLabel();
            jPanel2      = new JPanel(new GridBagLayout());
            JLabel canvasLabel = new JLabel(new ImageIcon(canvas));

            jPanel2.add(canvasLabel, null);

            jPanel3       = new JPanel();
            jRadioButton3 = new JRadioButton();
            jRadioButton4 = new JRadioButton();
            jRadioButton5 = new JRadioButton();
            jRadioButton6 = new JRadioButton();
            jRadioButton7 = new JRadioButton();
            jRadioButton8 = new JRadioButton();
            jButton1      = new JButton();

            DefaultCloseOperation = WindowConstants.EXIT_ON_CLOSE;
            Title = "FuNet1 --- powered by Neuroph";

            jPanel4.Border = BorderFactory.createTitledBorder("Line thickness");


            jSlider2.MajorTickSpacing = 10;
            jSlider2.Maximum          = 51;
            jSlider2.Minimum          = 1;
            jSlider2.MinorTickSpacing = 5;
            jSlider2.PaintTicks       = true;
            jSlider2.addChangeListener(new ChangeListenerAnonymousInnerClassHelper(this));

            //        jLabel1.setText("Stroke Size (Radius)");

            GroupLayout jPanel4Layout = new GroupLayout(jPanel4);

            jPanel4.Layout = jPanel4Layout;
            jPanel4Layout.HorizontalGroup = jPanel4Layout.createParallelGroup(GroupLayout.Alignment.LEADING).addGroup(jPanel4Layout.createSequentialGroup().addContainerGap().addGroup(jPanel4Layout.createParallelGroup(GroupLayout.Alignment.LEADING)).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED, 51, short.MaxValue).addGroup(jPanel4Layout.createParallelGroup(GroupLayout.Alignment.TRAILING).addComponent(jLabel1).addComponent(jSlider2, GroupLayout.PREFERRED_SIZE, 150, GroupLayout.PREFERRED_SIZE)).addContainerGap());

            label = new JLabel("");
            Font labelFont = label.Font;

            label.Font = new Font(labelFont.Name, Font.PLAIN, 30);


            jPanel4Layout.VerticalGroup = jPanel4Layout.createParallelGroup(GroupLayout.Alignment.LEADING).addGroup(jPanel4Layout.createParallelGroup(GroupLayout.Alignment.TRAILING).addComponent(jSlider2, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE).addGroup(jPanel4Layout.createSequentialGroup().addGroup(jPanel4Layout.createParallelGroup(GroupLayout.Alignment.BASELINE).addComponent(jLabel1)).addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED)));

            jPanel2.Background = new Color(0, 0, 0);
            jPanel2.Border     = BorderFactory.createBevelBorder(BevelBorder.RAISED);
            // add the listeners to the label that contains the canvas buffered image
            canvasLabel.addMouseListener(new MouseAdapterAnonymousInnerClassHelper(this));
            canvasLabel.addMouseMotionListener(new MouseMotionAdapterAnonymousInnerClassHelper(this));


            jButton1.Text = "Clear";
            jButton1.addActionListener(new ActionListenerAnonymousInnerClassHelper(this));

            GroupLayout layout = new GroupLayout(ContentPane);

            ContentPane.Layout     = layout;
            layout.HorizontalGroup = layout.createParallelGroup(GroupLayout.Alignment.LEADING).addGroup(layout.createSequentialGroup().addContainerGap().addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING).addComponent(jPanel2, GroupLayout.Alignment.TRAILING, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, short.MaxValue).addGroup(layout.createSequentialGroup().addComponent(jPanel4, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE).addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED).addComponent(jPanel3, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING).addComponent(jButton1, GroupLayout.DEFAULT_SIZE, 112, short.MaxValue).addComponent(label, GroupLayout.DEFAULT_SIZE, 112, short.MaxValue)))).addContainerGap());
            layout.VerticalGroup   = layout.createParallelGroup(GroupLayout.Alignment.LEADING).addGroup(layout.createSequentialGroup().addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING, false).addGroup(layout.createSequentialGroup().addGap(4, 4, 4).addComponent(jButton1, GroupLayout.PREFERRED_SIZE, 30, GroupLayout.PREFERRED_SIZE).addComponent(label, GroupLayout.PREFERRED_SIZE, 30, GroupLayout.PREFERRED_SIZE).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)).addComponent(jPanel4, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, short.MaxValue).addComponent(jPanel3, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, short.MaxValue)).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addComponent(jPanel2, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, short.MaxValue).addContainerGap());

            Graphics g = canvas.Graphics;

            g.Color = Color.WHITE;
            g.fillRect(0, 0, canvas.Width, canvas.Height);
            repaint();
            pack();
        }         // </editor-fold>
예제 #11
0
 public Header(Header src)
 {
     GroupLayout = new GroupLayout(src.GroupLayout);
 }
예제 #12
0
 public Header(JsonReader reader)
 {
     GroupLayout = (GroupLayout)Layout.Load(reader);
 }
예제 #13
0
 public Footer(Footer src)
 {
     GroupLayout = new GroupLayout(src.GroupLayout);
 }