Exemplo n.º 1
0
        /// <summary>
        /// Reads default serializable fields to stream. </summary>
        /// <exception cref="HeadlessException"> if
        /// <code>GraphicsEnvironment.isHeadless()</code> returns
        /// <code>true</code> </exception>
        /// <seealso cref= java.awt.GraphicsEnvironment#isHeadless </seealso>
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: private void readObject(java.io.ObjectInputStream s) throws ClassNotFoundException, java.io.IOException, HeadlessException
        private void ReadObject(ObjectInputStream s)
        {
            GraphicsEnvironment.CheckHeadless();
            // 4352819: Gotcha!  Cannot use s.defaultReadObject here and
            // then continue with reading optional data.  Use GetField instead.
            ObjectInputStream.GetField f = s.ReadFields();

            // Old fields
            ScrollbarDisplayPolicy_Renamed = f.Get("scrollbarDisplayPolicy", SCROLLBARS_AS_NEEDED);
            HAdjustable_Renamed            = (ScrollPaneAdjustable)f.Get("hAdjustable", null);
            VAdjustable_Renamed            = (ScrollPaneAdjustable)f.Get("vAdjustable", null);

            // Since 1.4
            WheelScrollingEnabled_Renamed = f.Get("wheelScrollingEnabled", DefaultWheelScroll);

            //      // Note to future maintainers
            //      if (f.defaulted("wheelScrollingEnabled")) {
            //          // We are reading pre-1.4 stream that doesn't have
            //          // optional data, not even the TC_ENDBLOCKDATA marker.
            //          // Reading anything after this point is unsafe as we will
            //          // read unrelated objects further down the stream (4352819).
            //      }
            //      else {
            //          // Reading data from 1.4 or later, it's ok to try to read
            //          // optional data as OptionalDataException with eof == true
            //          // will be correctly reported
            //      }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Create a new scrollpane container. </summary>
        /// <param name="scrollbarDisplayPolicy"> policy for when scrollbars should be shown </param>
        /// <exception cref="IllegalArgumentException"> if the specified scrollbar
        ///     display policy is invalid </exception>
        /// <exception cref="HeadlessException"> if GraphicsEnvironment.isHeadless()
        ///     returns true </exception>
        /// <seealso cref= java.awt.GraphicsEnvironment#isHeadless </seealso>
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @ConstructorProperties({"scrollbarDisplayPolicy"}) public ScrollPane(int scrollbarDisplayPolicy) throws HeadlessException
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
        public ScrollPane(int scrollbarDisplayPolicy)
        {
            GraphicsEnvironment.CheckHeadless();
            this.LayoutMgr      = null;
            this.Width_Renamed  = 100;
            this.Height_Renamed = 100;
            switch (scrollbarDisplayPolicy)
            {
            case SCROLLBARS_NEVER:
            case SCROLLBARS_AS_NEEDED:
            case SCROLLBARS_ALWAYS:
                this.ScrollbarDisplayPolicy_Renamed = scrollbarDisplayPolicy;
                break;

            default:
                throw new IllegalArgumentException("illegal scrollbar display policy");
            }

            VAdjustable_Renamed   = new ScrollPaneAdjustable(this, new PeerFixer(this, this), Adjustable_Fields.VERTICAL);
            HAdjustable_Renamed   = new ScrollPaneAdjustable(this, new PeerFixer(this, this), Adjustable_Fields.HORIZONTAL);
            WheelScrollingEnabled = DefaultWheelScroll;
        }
Exemplo n.º 3
0
//JAVA TO C# CONVERTER WARNING: 'final' parameters are not allowed in .NET:
//ORIGINAL LINE: public void setTypedValue(final ScrollPaneAdjustable adj, final int v, final int type)
            public virtual void SetTypedValue(ScrollPaneAdjustable adj, int v, int type)
            {
                adj.SetTypedValue(v, type);
            }