Voltage-gated ion channels control generation and propagation of action potentials in excitable cells. Significant progress has been made in understanding structure and function of the voltage-gated ion channels, highlighted by the high-resolution open-state structure of the voltage-gated potassium channel, K(v)1.2. However, because the structure of the closed state is unknown, the gating mechanism remains controversial. We adapted the rosetta membrane method to model the structures of the K(v)1.2 and KvAP channels using homology, de novo, and domain assembly methods and selected the most plausible models using a limited number of experimental constraints. Our model of K(v)1.2 in the open state is very similar in overall topology to the x-ray structure of this channel. Modeling of KvAP in the open state suggests that orientation of the voltage-sensing domain relative to the pore-forming domain is considerably different from the orientation in the K(v)1.2 open state and that the magnitude of the vertical movement of S4 is significantly greater. Structural modeling of closed state of K(v)1.2 suggests gating movement that can be viewed as a sum of two previously suggested mechanisms: translation (2-4 A) plus rotation ( approximately 180 degrees ) of the S4 segment as proposed in the original "sliding helix" or "helical screw" models coupled with a rolling motion of the S1-S3 segments around S4, similar to recent "transporter" models of gating. We propose a unified mechanism of voltage-dependent gating for K(v)1.2 and KvAP in which this major conformational change moves the gating charge across the electric field in an analogous way for both channels.