コード例 #1
0
 /// <summary>Creates new form ParserPanel</summary>
 public ParserPanel()
 {
     // constants for language specification
     // one second in milliseconds
     // parser takes approximately a minute to load
     // parser takes 5-60 seconds to parse a sentence
     // constants for finding nearest sentence boundary
     // for highlighting
     // worker threads to handle long operations
     // to monitor progress of long operations
     //private ProgressMonitor progressMonitor;
     // progress count
     // use glass pane to block input to components other than progressMonitor
     InitComponents();
     // create dialogs for file selection
     jfc        = new JFileChooser(Runtime.GetProperty("user.dir"));
     pageDialog = new OpenPageDialog(new Frame(), true);
     pageDialog.SetFileChooser(jfc);
     jfcLocation = new ParserPanel.JFileChooserLocation(jfc);
     tlp         = new PennTreebankLanguagePack();
     encoding    = tlp.GetEncoding();
     SetFont();
     // create a timer
     timer = new Timer(OneSecond, new ParserPanel.TimerListener(this));
     // for (un)highlighting text
     highlightStyle = new SimpleAttributeSet();
     normalStyle    = new SimpleAttributeSet();
     StyleConstants.SetBackground(highlightStyle, Color.yellow);
     StyleConstants.SetBackground(normalStyle, textPane.GetBackground());
     this.chooseJarParser = new JarFileChooser(".*\\.ser\\.gz", this);
 }
コード例 #2
0
        private IAttributeSet GetAttributeSet(string tag)
        {
            IMutableAttributeSet attr = new SimpleAttributeSet();
            Color color = tagToColorMap[tag];

            StyleConstants.SetBackground(attr, color);
            StyleConstants.SetForeground(attr, Color.White);
            return(attr);
        }
コード例 #3
0
        //private:

        void loadcontrols()
        {
            if (_datasource != null)
            {
                _numberofstacks = _datasource.Sections.Count;
                for (int i = 0; i < _numberofstacks; i++)
                {
                    IStackView stack = new IStackView();
                    stack.StackNumber       = i;
                    stack.Section           = i;
                    stack.BorderSource      = _bordersource;
                    stack.ThumbHeight       = _thumbheight;
                    stack.ThumbWidth        = _thumbwidth;
                    stack.BorderHeight      = _borderheight;
                    stack.BorderWidth       = _borderwidth;
                    stack.MaxScale          = _maxscale;
                    stack.StackHeight       = _listheight;
                    stack.VerticalPosition  = _verticalposition;
                    stack.MinStackWidth     = _minstackwidth;
                    stack.SpaceBetweenItems = _spacebetweenitems;
                    stack.DeviceWidth       = _minlistwidth;
                    stack.Source            = _datasource.Sections[i];
                    //header
                    _headercontrol.Author      = _datasource.Author;
                    _headercontrol.Title       = _datasource.Title;
                    _headercontrol.Description = _datasource.Description;
                    StyleConstants styles = new StyleConstants();
                    _headercontrol.ChapterColor = styles.SecondColors[_listnumber % 4];

                    stack.StackItemFullAnimationStarted    += StackItem_FullAnimationStarted;
                    stack.StackItemFullAnimationCompleted  += StackItem_FullAnimationCompleted;
                    stack.StackItemThumbAnimationStarted   += StackItem_ThumbAnimationStarted;
                    stack.StackItemThumbAnimationCompleted += StackItem_ThumbAnimationCompleted;

                    stack.StackSizeChangeStarted      += Stack_SizeChangeStarted;
                    stack.StackSizeChangeDelta        += Stack_SizeChangeDelta;
                    stack.StackSizeChangeCompleted    += Stack_SizeChangeCompleted;
                    stack.StackSizeAnimationStarted   += Stack_SizeAnimationStarted;
                    stack.StackSizeAnimationCompleted += Stack_SizeAnimationCompleted;

                    stack.IControlsComponentSelected += IControls_ComponentSelected;

                    //_startimage.Source = new BitmapImage(new Uri("ms-appx:///roadsdata/text"+(int)(i+1)+".png"));

                    if (stack.NumberOfItems == 1)
                    {
                        stack.SetToOpen();
                    }

                    _panel.Children.Add(stack);
                    _stacksvector.Add(stack);
                }
                _panel.Children.Add(_auxgrid);
                updatewidth();
            }
        }
コード例 #4
0
        void LOsInCircle_CollectionChanged(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e)
        {
            StyleConstants styles = new StyleConstants();

            loadLOsInCircle(e.NewStartingIndex);
            var vm = ViewModel as LOViewModel;

            down_menu.SelectElement(vm.LOCurrentIndex);
            booksource.TemporalColor = styles.MainAlphaColors[vm.LOCurrentIndex % 4];  //Util.GetColorbyIndex(vm.LOCurrentIndex);
        }
コード例 #5
0
        public void Select()
        {
            _isselected = true;
            // animate2color(_source.ChapterColor);
            StyleConstants styles = new StyleConstants();

            animate2color(styles.MainAlphaColors[_index % 4]);

            animate2double(1.04, "ScaleX");
            animate2double(1.04, "ScaleY");
        }
コード例 #6
0
    private void OnGUI()
    {
        StyleConstants.Init();
        ContentConstants.Init();

        DrawToolbar();
        DrawTODOList();
        DrawResizeArea();
        DrawDetail();

        if (selectChanged)
        {
            selectChanged = false;
            needRepaint   = true;
        }
    }
コード例 #7
0
 private void createAttributes()
 {
     attributes = new ConcurrentDictionary <Level, MutableAttributeSet>();
     for (int i = 0; i < levels.Length; i++)
     {
         MutableAttributeSet att = new SimpleAttributeSet();
         attributes[levels[i]] = att;
         StyleConstants.setFontSize(att, Settings.Instance.Font.Size);
         StyleConstants.setFontFamily(att, Settings.Instance.Font.Family);
     }
     StyleConstants.setForegRound(attributes[Level.FATAL], Color.red);
     StyleConstants.setForegRound(attributes[Level.ERROR], Color.red);
     StyleConstants.setForegRound(attributes[Level.WARN], Color.orange);
     StyleConstants.setForegRound(attributes[Level.INFO], Color.black);
     StyleConstants.setForegRound(attributes[Level.DEBUG], Color.gray);
     StyleConstants.setForegRound(attributes[Level.TRACE], Color.gray);
 }
コード例 #8
0
 private void RemoveTags()
 {
     if (editorPane.GetContentType().Equals("text/html"))
     {
         editorPane.SetText(htmlContents);
         editorPane.Revalidate();
         editorPane.Repaint();
     }
     else
     {
         DefaultStyledDocument doc  = (DefaultStyledDocument)editorPane.GetDocument();
         SimpleAttributeSet    attr = new SimpleAttributeSet();
         StyleConstants.SetForeground(attr, Color.Black);
         StyleConstants.SetBackground(attr, Color.White);
         doc.SetCharacterAttributes(0, doc.GetLength(), attr, false);
     }
     saveTaggedAs.SetEnabled(false);
 }
コード例 #9
0
        void select()
        {
            StyleConstants styles = new StyleConstants();

            this.Background = new SolidColorBrush(_infocolor);//ColorHelper.FromArgb(255,78,177,223));
            switch (IsOn)
            {
            case true:
                _stateimage.Source  = new BitmapImage(new Uri(SelectOnImage));
                _content.Foreground = new SolidColorBrush(Colors.White);
                break;

            case false:
                _stateimage.Source  = new BitmapImage(new Uri(SelectOffImage));
                _content.Foreground = new SolidColorBrush(Colors.White);
                break;
            }
        }
コード例 #10
0
        //  private String initText = "In";
        private void BuildContentPanel()
        {
            editorPane = new JEditorPane();
            editorPane.SetContentType("text/rtf");
            editorPane.AddKeyListener(new NERGUI.InputListener(this));
            //    defaultAttrSet = ((StyledEditorKit)editorPane.getEditorKit()).getInputAttributes();
            StyleConstants.SetFontFamily(defaultAttrSet, "Lucinda Sans");
            IDocument doc = new DefaultStyledDocument();

            editorPane.SetDocument(doc);
            try
            {
                doc.InsertString(0, initText, defaultAttrSet);
            }
            catch (Exception ex)
            {
                throw new Exception(ex);
            }
            JScrollPane scrollPane = new JScrollPane(editorPane);

            frame.GetContentPane().Add(scrollPane, BorderLayout.Center);
            editorPane.SetEditable(true);
        }
コード例 #11
0
        private string getColor(Level p)
        {
            Color c = StyleConstants.getForegRound(attributes[p]);

            return(c == null ? null : colorToString(c));
        }
コード例 #12
0
 private void setColor(Level p, string v)
 {
     StyleConstants.setForegRound(attributes[p], parseColor(v));
 }